[英]Webpack not properly compiling (Critical dependency: the request of a dependency is an expression)
I've been struggling with this issue for a few days now, and I can't tell what the problem is exactly. 我已经为这个问题苦苦挣扎了几天,但我无法确定问题到底出在哪里。 Basically, what's bothering me here is the following warning:
WARNING in ./node_modules/colors/lib/colors.js 141:29-43 Critical dependency: the request of a dependency is an expression
. 基本上,困扰我的是以下警告:
WARNING in ./node_modules/colors/lib/colors.js 141:29-43 Critical dependency: the request of a dependency is an expression
。 It causes my app to crash/not properly work. 它导致我的应用崩溃/无法正常工作。
I can make the other errors go away (such as ERROR in ./config/internals/environmentVars.js Module not found: Error: Can't resolve 'fs' in '/app/config/internals'
) by adding a line in my webpack config, but I cannot get rid of the first one. 我可以通过在其中添加一行来使其他错误消失(例如
ERROR in ./config/internals/environmentVars.js Module not found: Error: Can't resolve 'fs' in '/app/config/internals'
)我的webpack配置,但我不能摆脱第一个。 Any help on this topic will be greatly appreciated! 对此主题的任何帮助将不胜感激! I can provide you with more code if you need it.
如果需要,我可以为您提供更多代码。
I had the same problem compiling a node application. 我在编译节点应用程序时遇到了同样的问题。 Solved placing in the webpack.config file the target option.
解决了将webpack.config文件中的目标选项放置的问题 。
target: 'node'
Hope this helps 希望这可以帮助
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.