[solved] Service functions is not available: Angular app + Firebase Auth Ext

Heyyo!

Trying to get the Moralis Firebase Auth Extension to work with my Angular project by following Jays tutorial and am stuck in an issue similar to this one where Iā€™m getting the following error on trying to connect to metamask. moralis_firebase_err.

To connect to the service from the client side Iā€™m doing the following: moralis_firebase_err1

That code snippet is whatā€™s causing the ā€œService functions is not availableā€ error above.

The solution presented in the issue similar to this one was adding the correct ā€œregionOrCustomDomainā€ param when calling getMoralisAuth. This didnā€™t solve the issue for me.

What did change the error for me was when I defined firebase functions like so,

but the error that followed is what brought me here.

After that error I installed @angular/fire and imported it from the app.modules file but the error keeps persisting.

I feel that I might need to install the whole angular/fire suite but I donā€™t think I have to go that far to interact with the extension. Hopefully someone can shed some light on this issue.

Thanks!

Maybe this thread helps. It seems to have a similar title

Hey! That one didnā€™t help. I mention in the first sentence Iā€™m facing an issue similar to that one you pointed out (its the same issue xD) and a few points later I stated that the solution, which was changing the region param, didnā€™t help.

Thanks a lot for the quick reply tho! Iā€™m assuming thereā€™s something extra I have to invoke for Angular to accept the connection to the Firebase Extension but Iā€™m not really sure.

Small update.

After properly injecting the functions from the app.module.ts NgModule the above error stating something about AngularFileModule is gone. Now Iā€™m facing some errors that seem to be web3 provider issues, which are hella easier & more verbose than the errors I was facing before.

New Error
image

Example on how Iā€™m using ethers to get the current web3 provider.
image

Will keep updating until I find the solution.

Thanks for reading!

1 Like

Another update. My main problem was my @moralisweb3/client-firebase-evm-auth import.

I was importing getMoralisAuth from @moralisweb3/client-firebase-auth but the correct package to import it from is @moralisweb3/client-firebase-EVM-auth. Totally missed that detail.

Now Iā€™m facing a CORS issue but that should be even simpler to solve.

Hereā€™s the error. Will post the final solution to close this thread. :fire::sparkling_heart:

1 Like

Final update. Solved.

Was finally able to make this work by redoing every step again twice. What i did different was that after installing the moralis firebase extension on my existing project, i deleted my node modules & my package-lock.json & it ended up working.

Apparently installing all the necessary firebase packages as you develop will make certain dependencies not sync correctly.

This is how i connect to the extension in Angular (same as react)
image

This is how I connect to metamask in Angular.
image

The CORS error I was receiving before just went away after I reinstalled everything.

TLDR

Do everything in the tutorial BUT you must delete/reinstall node_modules & package-lock.json for it to work correctly.

This wasnā€™t necessary in the tutorial video because Jay used a pre-prepared project that already had all necessary dependencies. In my case I just went along and added what I was missing to my already existing Angular project with already had a firebase version, didnā€™t have the moralisweb3 package, etc.

Thanks to everyone who took a look at this! Hope it helps. :man_dancing:t5::man_dancing:t5::man_dancing:t5:

1 Like

still you have not used @moralisweb3/client-firebase-EVM-auth .instead you are using @moralisweb3/client-firebase-auth in your latest repy and you were saying earlier, to use @moralisweb3/client-firebase-EVM-auth .

Hi @anand_jaat

Can you please create a new post in case if the users solutions does not work?

Also you can have a look the demo code from our github, if that helps.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.