question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Module not found: Error: Can't resolve '@firebase/XXXX' in '~/node_modules/firebase/...' after Firebase 4.8.1

See original GitHub issue

Version info

Angular: 5.1.1 Firebase: 4.8.1 AngularFire: 5.0.0-rc.4 Other (e.g. Ionic/Cordova, Node, browser, operating system): Other latest; OS: macOS latest when submitting

How to reproduce these conditions

npm start failed to compile Failing test unit, Plunkr, or JSFiddle demonstrating the problem

Steps to set up and reproduce

Sample data and security rules

<-- include/attach/link to some json sample data (or provide credentials to a sanitized, test Firebase project) -->

Debug output

** Errors in the JavaScript console **

Can’t resolve ‘@firebase/polyfill’ in … Can’t resolve ‘@firebase/firestore’ Can’t resolve ‘@firebase/database’ Can’t resolve ‘@firebase/auth’ Can’t resolve ‘@firebase/app’ in ‘/…/node_modules/firebase/XXXX’ @ ./node_modules/firebase/auth/index.js 17:0-25 @ ./node_modules/angularfire2/auth/auth.module.js @ ./node_modules/angularfire2/auth/public_api.js @ ./node_modules/angularfire2/auth/index.js @ ./src/app/app.module.ngfactory.js @ ./src/main.browser.ts @ multi (webpack)-dev-server/client?http://0.0.0.0:8080 ./src/main.browser.ts

** Output from firebase.database().enableLogging(true); **

** Screenshots **

Expected behavior

Actual behavior

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:18 (2 by maintainers)

github_iconTop GitHub Comments

29reactions
zgosalvezcommented, Dec 19, 2017

Rolling back to "firebase": "4.8.0" “fixed” it for me.

24reactions
elroncommented, Apr 29, 2020

VS Code mistakenly put the wrong source path

// Possible wrong paths
import { AngularFirestore } from '@angular/fire/firestore/firestore';
import { AngularFirestoreDocument } from '@angular/fire/firestore/public_api';

// The right path
import { AngularFirestore, AngularFirestoreDocument } from '@angular/fire/firestore';`
Read more comments on GitHub >

github_iconTop Results From Across the Web

Module not found: Can't resolve 'firebase' in
npm i firebase now installs v9 Modular SDK so you cannot used the old imports. Try refactoring your code to this:
Read more >
Module not found: Can't resolve 'firebase'
To solve the error "Module not found: Error: Can't resolve 'firebase'", make sure to install the firebase package by opening your terminal in...
Read more >
Issues
Example: Firebase - Module not found: Can't resolve '. ... command with Select a template below... firebase-auth . after npm run start this...
Read more >
unable to resolve "firebase" from "app.js"
js file in the src folder. I am getting the following error on ESLint: Unable to resolve path to module './src/App'. (import/no-unresolved).
Read more >
Module not found: can't resolve 'firebase/storage' in next.js
i want to implement firebase in the next.js file but i keep getting the error module not found (i already use yarn add...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found