Webpack传输轮询错误

我在启动webpack-dev-server的express / webpack应用程序中有下面的咕噜任务:

"webpack-dev-server": { options: { webpack: webpackConfig, publicPath: '/assets/', watch: true, inline: true, hot: true, quiet: true }, start: { keepAlive: true, webpack: { devtool: 'eval', debug: true } } } 

我遇到的问题是,轮询者只是垃圾邮件我的铬控制台,这将是非常讨厌的,当涉及到debugging。 (我在裸机应用程序阶段)。

在这里输入图像描述

任何人有任何想法可能造成这一点?

发现它自己:

host选项设置为“localhost”

这里是一个在grunt-webpack中产生错误的代码 。 默认选项设置为

 var options = _.merge({ port: 8080, host: undefined }, options); 

然后

 if (options.inline) { var devClient = ["webpack-dev-server/client?" + protocol + "://" + options.host + ":" + options.port]; ... } 

所以,要解决你的问题在gruntconfiguration中指定主机选项

 "webpack-dev-server": { options: { webpack: webpackConfig, publicPath: '/assets/', watch: true, inline: true, hot: true, quiet: true, host: 'localhost' }, start: { keepAlive: true, webpack: { devtool: 'eval', debug: true } } } 

在我的情况下,我只是没有看到我试图运行devserver时出现了编译错误。 这导致了同样的问题。

注意到后,我觉得非常愚蠢。