4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Firebase 9.0.0 を使うと export 'firestore' was not found とか言われる

Last updated at Posted at 2021-08-26

トラブル

ある日突然、import firebase from "firebase/app"; とかすると、"export 'firestore' (imported as 'firebase') was not found in 'firebase/app' とか言われて、何をどうしても直らなくなりました。

いきなり結論

試した環境は以下の通り (Ubuntu 20.04LTS)。

.sh
$vue --version
4.5.13
$ firebase --version
9.16.5
$ npm -v
7.21.0
$ yarn -v
1.22.11
$ node -v
v14.17.4

これで、

$ vue create myproject

とすると、firebase 9.0.0 が使われるようです。それを 8.10.0 に治したらエラーが出なくなりました。下記のような感じです。

package.json
  "dependencies": {
    "core-js": "^3.6.5",
    "firebase": "^8.10.0",
    "firebaseui": "^5.0.0",
    "vue": "^2.6.11",
    "vue-router": "^3.2.0",
    "vuetify": "^2.4.0"
  }

後は普通に、

.js
import firebase from 'firebase/app';
import "firebase/auth";

とかで、エラーはでなくなりました。

これ、まじで分らんかったんだけど、こんなこと起こるのうちだけ?

参考

4
2
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?