My apologize, I don't understand. In ur article, you give that example :
import * as firebase from "firebase/app";
import "firebase/analytics";
// put this after firebase.initializeApp(...)
// make sure it executes before any logEvent
firebase.analytics();
// alias
Vue.prototype.$analytics = firebase.analytics();
When I try this on my project I have this error:
This dependency was not found:
* firebase/analytics in ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vuetify-loader/lib/loader.js??ref--18-0!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/NavBar.vue?vue&type=script&lang=js&
To install it, you can run: npm install --save firebase/analytics
Even if i did a npm install firebase
So what should I do to set forebase/analytics in my nodejs/vuejs project ?
I updated the setup section with step by step commands to setup vue app. I executed it step by step and checked that it works. Let me know if it works for you.
Thanks again for ur time and ur reply.
My apologize, I don't understand. In ur article, you give that example :
When I try this on my project I have this error:
Even if i did a
npm install firebase
So what should I do to set forebase/analytics in my nodejs/vuejs project ?
Thanks for ur help and ur time
Have you initialized firebase?
Yes. Error comes on the second line with :
Can you share a project where this works ?
I updated the setup section with step by step commands to setup vue app. I executed it step by step and checked that it works. Let me know if it works for you.
Sorry,
I still have the same problem importing firebase/analytics
if you have time to check : github.com/tibetoine/friends-party
Please follow updated setup section from the beginning. I added also versions and package.json for comparison.
In your project you only need to update firebase version, the one you use is too old and doesn't have analytics. Go to package.json and update it to: