简体   繁体   English

Webpack编译不正确(严重依赖性:依赖性的请求是一个表达式)

[英]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.

相关问题 关键依赖:依赖的请求是一个表达式 webpack svelte - Critical dependency: the request of a dependency is an expression webpack svelte FabricJs,Webpack无法编译-严重依赖 - FabricJs, Webpack not compiling - Critical dependency ./node_modules/express/lib/view.js 中的 Webpack 警告关键依赖:依赖的请求是一个表达式 - Webpack WARNING in ./node_modules/express/lib/view.js Critical dependency: the request of a dependency is an expression 关键依赖:一个依赖的请求是一个表达式——react-universal-component - Critical dependency: the request of a dependency is an expression -- react-universal-component 关键依赖项:依赖项的请求是jQuery Form Validator插件上的一个表达式 - Critical dependency: the request of a dependency is an expression on jQuery Form Validator plugin 关键依赖:依赖的请求是使用延迟加载时的表达式 - Critical dependency: the request of a dependency is an expression while using lazy loading 关键依赖:依赖的请求是一个表达式(Angular CLI 警告) - Critical dependency: the request of a dependency is an expression (Angular CLI Warning) 如何解决我的npm包的“关键依赖关系:依赖关系的请求是一个表达式”错误? - How to resolve “Critical dependency: the request of a dependency is an expression” error for my npm package? Webpack Express无法解析模块“ fs”,请求依赖关系为表达式 - Webpack Express Cannot Resolve Module 'fs', Request Dependency is Expression jQuery required(dependency-expression)无法正常工作 - jQuery required( dependency-expression ) is not working properly
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM