尽管我的应用程序正常运行,但webpack出现奇怪的错误

问题描述

我的应用程序正在运行,但控制台也会打印此错误(Windows 10):

sockjs.js:1606 GET http://localhost:9000/sockjs-node/info?t=1601299078692 net::ERR_CONNECTION_REFUSED

不知道为什么。 任何帮助将不胜感激!

我的代码基本上可以正常工作,每次我运行项目时,它都会弹出此错误 'npm run start'。

enter image description here

我的webpack.config.js是:

const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');

module.exports={
    entry:['babel-polyfill','./src/js/index.js'],output:{
    path: path.resolve(__dirname,'dist'),filename: 'js/bundle.js'
},devServer:{
    contentBase:'./dist'
},plugins:[
    new HtmlWebpackPlugin({
        filename:'index.html',template: './src/index.html'
    })
],module:{
    rules: [
        {
            test: /\.js$/,exclude: /node_module/,use:{
                loader: 'babel-loader'
            }
        }
    ]
}

};

我以前没有Webpack的背景。几个小时前我才开始研究它。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)