GUN.js导致生成警告:关键依赖项:依赖项的请求是一个表达式



我的应用程序上有GUN.js,它导致了这个麻烦的警告。如何清除此警告?

WARNING in ./node_modules/gun/gun.js 6:17-29
Critical dependency: the request of a dependency is an expression
@ ./src/components/MessageHandler.js 7:0-26 9:14-17
@ ./src/App.js 20:0-61 230:37-51
@ ./src/index.js 7:0-24 13:33-36
1 warning has detailed information that is not shown.
Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.
webpack 5.67.0 compiled with 1 warning in 174 ms

import Gun from 'gun/gun'import Gun from 'gun'我都试过了。

这个错误应该在最新的GitHub main上修复。

它似乎与有关

如何在不使用React Native expo 动态需求的情况下访问GUNJS中的SEA模块

(请不要删除我的帖子,我不是这里的mod,我只是一个试图帮助解决问题的OSS作者,我没有时间弄清楚所有规则,我不想关闭或删除别人的问题,因为这让我看起来很糟糕。如果其他人想,他们可以,但在那之前,人们需要回答他们的问题。谢谢!(

解决方案在问题中https://github.com/amark/gun/issues/743.我将noParse添加到WebPack配置中就足够了。

module: {
noParse: /gun.js$/,
...
}

最新更新