0

我正在使用firebase-adminFirebase 中的模块处理我的 index.js 文件,在我决定将apple-icloud模块 ( https://github.com/MauriceConrad/iCloud-API ) 导入我的 index.js 文件之前,一切正常。

我需要像这样:

var iCloud = require('apple-icloud');
var admin = require('firebase-admin');

在我使用的行:

var db = admin.database();

程序停止并抛出此错误:

/home/loris/HHIOT/node_modules/@firebase/util/dist/index.node.cjs.js:64
        throw assertionError(message);
        ^

Error: Firebase Database (${JSCORE_VERSION}) INTERNAL ASSERT FAILED: Missing index implementation for fillDefaults
    at assertionError (/home/loris/HHIOT/node_modules/@firebase/util/dist/index.node.cjs.js:73:12)
    at Object.assert (/home/loris/HHIOT/node_modules/@firebase/util/dist/index.node.cjs.js:64:15)
    at /home/loris/HHIOT/node_modules/@firebase/database/dist/index.node.cjs.js:3347:18
    at Object.map (/home/loris/HHIOT/node_modules/@firebase/util/dist/index.node.cjs.js:896:22)
    at IndexMap.addToIndexes (/home/loris/HHIOT/node_modules/@firebase/database/dist/index.node.cjs.js:3345:31)
    at ChildrenNode.updateImmediateChild (/home/loris/HHIOT/node_modules/@firebase/database/dist/index.node.cjs.js:3545:46)
    at ChildrenNode.updateChild (/home/loris/HHIOT/node_modules/@firebase/database/dist/index.node.cjs.js:3560:25)
    at ChildrenNode.updateChild (/home/loris/HHIOT/node_modules/@firebase/database/dist/index.node.cjs.js:3559:67)
    at SnapshotHolder.updateSnapshot (/home/loris/HHIOT/node_modules/@firebase/database/dist/index.node.cjs.js:9368:41)
    at Repo.updateInfo_ (/home/loris/HHIOT/node_modules/@firebase/database/dist/index.node.cjs.js:12882:24)

我尝试在单独的文件中导入 apple-icloud 模块,它确实有效。似乎只有在同时需要 apple-icloud 和 firebase-admin 时才会发生此错误。

我发现如果我在 firebase 初始化后需要该模块,它确实可以工作,知道为什么吗?

这可能是什么原因?谢谢。

4

0 回答 0