10

I've installed firebase@9.0.1, using yarn. The package seems working fine but it gives an error just after running yarn install as given.

Module not found: Error: Package path . is not exported from package /Users/trinity/Projects/hello/node_modules/firebase (see exports field in /Users/trinity/Projects/hello/node_modules/firebase/package.json)

Just for reference, attaching the installed set of libraries here.

➜  hello git:(main) ✗ yarn list --depth=0 | grep firebase
├─ @firebase/analytics-compat@0.1.1
├─ @firebase/analytics-types@0.7.0
├─ @firebase/analytics@0.7.0
├─ @firebase/app-check-compat@0.1.1
├─ @firebase/app-check-interop-types@0.1.0
├─ @firebase/app-check@0.4.0
├─ @firebase/app-compat@0.1.1
├─ @firebase/app-types@0.7.0
├─ @firebase/app@0.7.0
├─ @firebase/auth-compat@0.1.1
├─ @firebase/auth-interop-types@0.1.6
├─ @firebase/auth-types@0.11.0
├─ @firebase/auth@0.17.1
├─ @firebase/component@0.5.6
├─ @firebase/database-compat@0.1.0
├─ @firebase/database-types@0.9.0
├─ @firebase/database@0.12.0
├─ @firebase/firestore-compat@0.1.1
├─ @firebase/firestore-types@2.5.0
├─ @firebase/firestore@3.0.1
├─ @firebase/functions-compat@0.1.1
├─ @firebase/functions-types@0.5.0
├─ @firebase/functions@0.7.0
├─ @firebase/installations@0.5.0
├─ @firebase/logger@0.2.6
├─ @firebase/messaging-compat@0.1.0
├─ @firebase/messaging-interop-types@0.1.0
├─ @firebase/messaging@0.9.0
├─ @firebase/performance-compat@0.1.0
├─ @firebase/performance-types@0.1.0
├─ @firebase/performance@0.5.0
├─ @firebase/polyfill@0.3.36
├─ @firebase/remote-config-compat@0.1.0
├─ @firebase/remote-config-types@0.2.0
├─ @firebase/remote-config@0.2.0
├─ @firebase/storage-compat@0.1.1
├─ @firebase/storage-types@0.6.0
├─ @firebase/storage@0.8.1
├─ @firebase/util@1.3.0
├─ @firebase/webchannel-wrapper@0.5.1
├─ firebase@9.0.1
➜  hello git:(main) ✗

The development environment is an electron, I'm using ERB template for the project. Yarn installs the dependency fine, the problem appears in the post-install script. Please leave any clue for resolution. Thanks

Kiran Maniya
  • 8,453
  • 9
  • 58
  • 81

2 Answers2

3

Try this:

import * as firebase from "firebase/app"

Found here: https://stackoverflow.com/a/68984595/903000

Mike
  • 2,633
  • 6
  • 31
  • 41
1

I had a similar error, and I realized there was a name conflict because I named one of my folders "firebase". I changed it to some other thing and then the error was gone.