Nuxt.jsでpluginsフォルダ内のfirebase.jsに以下の記述をしているのですが、"export 'db' was not found in '@/plugins/firebase'
と"export 'firebase' was not found in '@/plugins/firebase'
というエラーが表示されます。
最後のexport defaultが何故効いていないのかが分かりません。
分かる方がおられましたらご教授頂ければ幸いです。
import Vue from 'vue' import * as firebase from 'firebase/app' import 'firebase/auth' import 'firebase/firestore' import 'firebase/storage' firebase.initializeApp({ apiKey: 'API_KEY', authDomain: 'PROJECT_ID.firebaseapp.com', databaseURL: 'https://PROJECT_ID.firebaseio.com', projectId: 'PROJECT_ID', storageBucket: 'PROJECT_ID.appspot.com', messagingSenderId: 'SENDER_ID' }) Vue.prototype.$firebase = firebase const db = firebase.firestore() export default { firebase, db }
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/06/25 05:52