Error: Failed to load function definition from source: Failed to generate manifest from function source: Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/firestore' is not defined by "exports" in /Users/macbook/Desktop/ein-itin-firebase-functions/functions/node_modules/firebase-admin/package.json
3 Answers
My Solution is change the
import { getFirestore } from "firebase-admin/lib/firestore";
to
import { getFirestore } from "firebase-admin/firestore";
Check your log
Open the following file and you can see the specific error that caused this
firebase-debug.log
Wherever you're using the functions
key word, you must also import the proper library:
Example:
exports.helloWorld = functions.https.onRequest((request, response) => {
functions.logger.info("Hello logs!", {structuredData: true});
response.send("Hello from Firebase!");
});
then import const functions = require("firebase-functions");