Firebase/firestore issue
See original GitHub issue⚠️ IMPORTANT ⚠️ Please check the following list before proceeding. If you ignore this issue template, your issue will be directly closed.
- Read the docs.
- Use Vite >=2.0. (1.x is no longer supported)
- If the issue is related to 1.x -> 2.0 upgrade, read the Migration Guide first.
Describe the bug
When trying to use Firebase 8.2.3
I get this error:
[plugin:vite:import-analysis] Deep import "firebase/app" should be avoided because dependency "firebase" has been pre-optimized. Prefer importing directly from the module entry:
import { ... } from "firebase"
If the used import is not exported from the package's main entry and can only be attained via deep import, you can explicitly add the deep import path to "optimizeDeps.include" in vite.config.js.
I searched the issues and found related issues to firebase auth, but I’m not including firebase auth, only firestore.
Reproduction
Just add this anywhere:
import Firebase from 'firebase/app'
import 'firebase/firestore'
System Info
vite
version: ^2.0.0-beta.29- Operating System: macOS Big Sur
- Node version: 15.5
- Package manager (npm/yarn/pnpm) and version: npm
Question
When the error says add the deep import path to "optimizeDeps.include" in vite.config.js.
how can I know what the “deep import path” is?
Thanks a lot!!
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Cloud Firestore - Firebase
Use our flexible, scalable NoSQL cloud database to store and sync data for client- and server-side development.
Read more >Issues · firebase/firebase-js-sdk - GitHub
@firebase/rules-unit-testing + vitest throws "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore" ...
Read more >Flutter - Firebase Firestore operation is not working
I am having a problem. First of all my code: FirebaseAuth _auth = FirebaseAuth.instance; FirebaseFirestore _firestore ...
Read more >@firebase/firestore - npm
The Cloud Firestore component of the Firebase JS SDK.. Latest version: 3.8.0, last published: 17 days ago. Start using @firebase/firestore ...
Read more >cloud_firestore | Flutter Package - Pub.dev
Please file FlutterFire specific issues, bugs, or feature requests in our issue ... Plugin issues that are not specific to FlutterFire can be...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
it worked when I did this in
vite.config.ts
It’s no longer needed in most cases.