Skip to content
Advertisement

Error in Firebasse”assert.ts:128 Uncaught FirebaseError: Firebase: Error (auth/invalid-api-key)

Why do I have the error that it says invalid API keys?

This is the sample .env.local

JavaScript

In another file:

JavaScript

This is the error:

enter image description here

The Package.json:

enter image description here

Advertisement

Answer

Make sure your .env.local is placed in the root directory, and not in any subfolders like src or public. Other than that, nothing seems to be wrong with your code. Just to be safe, cross check your API key with firebase. P.S. There’s no need to hide your firebase public API key, its going to be visible in your app to the general public anyway.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement