![](/img/trans.png)
[英]Module build failed (from ./node_modules/source-map-loader/dist/cjs.js)
[英]uncaught promise rejection: failed to eval source for module 'nanoid': node_modules/nanoid/index.cjs
我正在尝试使用 nanoid ( https://www.npmjs.com/package/nanoid/v/2.1.2 )
exports = async function(){
const nanoid = require("nanoid");
const uid = nanoid(10);
}
从 MongoDB realm 运行时,但它抛出:
uncaught promise rejection: failed to eval source for module 'nanoid': node_modules/nanoid/index.cjs: Line 9:7 Unexpected identifier (and 16 more errors)
这就是我可以从 Realm 仪表板中看到的所有错误。
可能缺少什么?
对我有用的解决方案:
npm i nanoid@2.1.2
然后通过仪表板将package上传到MongoDB Realm函数。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.