7
3

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.

【Flutter Web】TypeError: dart.global.firebase.firestore is not a function (Flutter WebでFirestoreにアクセスできない)

Posted at

エラー内容

Flutter WebにFirestoreを使ってデータ保存機能を追加しようとしたところ、下記のエラーが発生しました。

TypeError: dart.global.firebase.firestore is not a function
    at /* --- 省略 --- */

解決方法

web/index.htmlファイルのbodyタグ内に以下を記述。
※本記事執筆時ではver7.14.4ですが、ここは各自最新verを記述してください。

index.html
<script src="https://www.gstatic.com/firebasejs/7.14.4/firebase-firestore.js"></script>

記述できたらもう一度ビルドし直すと反映されます。

参考記事

7
3
1

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
7
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?