'firebase' npm package is used in Functions backend for .initializeApp(config) and .Auth().signInWithEmailAndPassword(email, password)
Firebase deploy/serve throws this error:
+ functions: Using node@16 from host.
i functions: Watching "C:\Users\ewert\Documents\Study\Udemy\Authentication\Firebase Practice\functions" for Cloud Functions...
!! functions: Failed to load function definition from source: FirebaseError: Failed to load function definition from source: Failed to generate manifest from function source: Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in C:\Users\ewert\Documents\Study\Udemy\Authentication\Firebase Practice\functions\node_modules\firebase\package.json
Re-installing firebase package, updating Node, npm and using 'firebase-admin' did not solve the issue.
Tutorial link, step Section 2.1
Firebase version: 11.7.0
I'm very thankful if you can help.
The Firebase js sdk is for client-side use only. In order to interact with Firebase from your backend environment (ie cloud functions, node backend, etc), you must use the admin-sdk.
Keep in mind that since the admin-sdk runs in a secure, trusted environment, it has elevated privileges and will bypass security rules, so make sure you're validating your data in your functions.
You can view the full documentation for the admin-sdk here: Firebase Admin SDK
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With