WDS断开连接错误,codesandbox.io

问题描述

我在此沙盒中不断收到此WDS断开连接错误。这是webpack.config文件

const path = require("path");
const webpack = require("webpack");

module.exports = {
  entry: "./src/index.js",mode: "development",module: {
    rules: [
      {
        enforce: "pre",test: /\.(js|jsx)$/,exclude: /(node_modules|bower_components)/,loader: "eslint-loader"
      },{
        test: /\.(js|jsx)$/,loader: "babel-loader",options: { presets: ["@babel/env"] }
      },{
        test: /\.css$/,use: ["style-loader","css-loader"]
      }
    ]
  },resolve: { extensions: ["*",".js",".jsx"] },output: {
    path: path.resolve(__dirname,"dist/"),publicPath: "/dist/",filename: "main.js"
  },devServer: {
    disableHostCheck: true,contentBase: path.join(__dirname,"public/"),port: 8080,publicPath: "http://localhost:8080/dist/",hotOnly: true
  },plugins: [new webpack.HotModuleReplacementPlugin()]
};

这在我的本地计算机上工作正常,但是配置不同。为了使网页完全显示,我不得不对codeandBox进行一些不同的配置。现在显示,但在控制台中显示WDS disconnected错误,并且控制台不起作用。 link

解决方法

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

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

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