react+webpack在调试(npm run dev)报错

在react(vue)+webpack中的调试时,node会报如下错误信息

(node:9016) DeprecationWarning: loaderUtils.parseQuery() received a non-string v
alue which can be problematic, see https://github.com/webpack/loader-utils/issue
s/56
parseQuery() will be replaced with getOptions() in the next major version of loa
der-utils.

最终解决办法

process.noDeprecation = true

在dev-server .js中添加以上代码
var config = require('../config')
if (!process.env.NODE_ENV) {
 process.env.NODE_ENV = JSON.parse(config.dev.env.NODE_ENV);
 process.noDeprecation = true //添加在此位置
}
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容