Firebase Function Failed to load function definition from so



错误:Failed to load function definition from source: Failed to generate manifest from function source: Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath '。/lib/firestore'没有被"exports"定义;在/用户/电脑/桌面/ein-itin-firebase-functions/功能/node_modules/firebase-admin package.json

我的解决方案是改变

import { getFirestore } from "firebase-admin/lib/firestore";

import { getFirestore } from "firebase-admin/firestore";

在使用functions关键字时,还必须导入适当的库:

的例子:

exports.helloWorld = functions.https.onRequest((request, response) => {
functions.logger.info("Hello logs!", {structuredData: true});
response.send("Hello from Firebase!");
});

然后导入const functions = require("firebase-functions");

查看日志

打开以下文件,您可以看到导致此

的特定错误firebase-debug.log

相关内容

  • 没有找到相关文章

最新更新