Reputation:
Creating a fresh Nuxt project and installing firebase dependencies:
npm i firebase @nuxtjs/firebase
Following the library dependency @nuxtjs/firebase in nuxt.config.ts
:
modules: [
// https://go.nuxtjs.dev/axios
'@nuxtjs/axios',
// https://firebase.nuxtjs.org/
'@nuxtjs/firebase',
],
firebase: {
config: {
apiKey: process.env.FIREBASE_API_KEY,
authDomain: process.env.FIREBASE_AUTH_DOMAIN,
projectId: process.env.FIREBASE_PROJECT_ID,
storageBucket: process.env.FIREBASE_STORAGE_BUCKET,
messagingSenderId: process.env.FIREBASE_MESSAGING_SENDER_ID,
appId: process.env.FIREBASE_APP_ID,
measurementId: process.env.FIREBASE_MEASUREMENT_ID,
},
services: {
analytics: true,
},
},
If I log on a component:
console.log(this.$fire.analytics)
But in the Nuxt linter on terminal I see:
Someone can help me to understand this errors? Thank you all.
Upvotes: 0
Views: 143
Reputation:
I just find the problem! We need to add firebase types to tsconfig.json
.
"types": [
"@nuxt/types",
"@nuxtjs/axios",
"@types/node",
"@nuxtjs/firebase"
]
Upvotes: 1