1

I cannot start project with yarn run dev and have this error:

FirebaseError: Analytics: "measurementId" field is empty in Firebase config. Firebase Analytics requires this field to contain a valid measurement ID. (analytics/no-ga-id).

I deleted yarn.lock file, added some extra variables to.env file. Where can I find measurementId? What might help in this kind of error? May be somebody have already faced with such problem. Thanks :)

2 Answers2

1

This has nothing to do with your yarn lock file. Which client side sdk are you using for Firebase? Angularfire perhaps? I assume you did put your firebase config in your environment file of your angular app. Just add the property "measurementId" to it with the correct value, and you are good to go. You can get this property in your Firebase project.

Kevin Boosten
  • 244
  • 1
  • 11
0

If your app uses the Firebase hosting and uses reserved URLs you are good to go since it automatically handles the configuration for your application. It seems it isn't your case.

You should add or update the config file to ensure the measurementId field is present. To find the config file go to Your apps card in your Project settings from the Firebase Console.

It can be useful as well: How to get the measurementId from the Firebase config?

Filipe Brito
  • 5,329
  • 5
  • 32
  • 42