Closed RodrigoBertotti closed 3 years ago
Hey @DesiredApp
Analytics is a client-only service and won't be initialized on the server. The created()
lifecycle method gets triggered on the server - therefore the error message.
If I were you I would put the analytics code in the mounted()
lifecycle hook, or you can wrap the code in if (process. isClient) {}
Hope that makes sense. Pascal
got it! thank you very much!
Version
@nuxtjs/firebase: ^7.1.1 firebase: 8.1.2 nuxt: 2.14.9
Reproduction Link
https://codesandbox.io/s/peaceful-goldwasser-g7nkk?file=/pages/index.vue
Steps to reproduce
What is Expected?
Save the log event
What is actually happening?
Cannot read property 'logEvent' of undefined