Skip to content
Advertisement

`Firebase` package was successfully found. However, this package itself specifies a `main` module field that could not be resolved

I’m trying to read and write to firestore, use firebase’s authentication, and firebase’s storage within a expo managed react-native application.

Full Error:

JavaScript

My firebase config file:

JavaScript

I installed the firebase package with:

JavaScript

Any help would be greatly appreciated. Thank you!

Advertisement

Answer

To reduce the size of the app, firebase SDK (v9.0.0) became modular. You can no longer do the import statement like before on v8.

You have two options.

  1. Use the backwards compatible way. (it will be later removed):

This:

JavaScript

Should be changed to:

JavaScript
  1. Refactor your code now.

From this:

JavaScript

To this:

JavaScript

You should definitely check the documentation

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement