Whenever I attempt to run npm run dev, I encounter a websocket error. I'm part of a team with WSL and Mac users, and the repository runs smoothly for everyone else except me. I'm puzzled as to why I'm the only one facing this issue while trying to run our application.
Facing Websocket Error during npm run dev
This is the webpack configuration file we are using.
var path = require("path");
var HtmlWebPackPlugin = require("html-webpack-plugin");
module.exports = {
entry: "./src/index.js",
output: {
path: path.join(__dirname, "build"),
publicPath: '/build',
filename: "index_bundle.js"
},
mode: process.env.NODE_ENV,
module: {
rules: [
{
test: /\.tsx?/,
use: 'ts-loader',
exclude: /node_modules/,
},
{
test: /\.jsx?/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env', '@babel/preset-react'],
plugins: ["@babel/plugin-syntax-jsx"]
},
},
exclude: /npm_modules/
},
{
test: /\.s?css/,
use: ["style-loader", "css-loader", "sass-loader"],
},
{
test: /\.(png|jpg|gif|svg)$/,
use: [
{
loader: "file-loader",
options: {
outputPath: '/images'
}
}
]
},
]
},
resolve: {
extensions: [".js", ".jsx", ".tsx", ".ts"],
},
devServer: {
static: {
directory: path.join(__dirname, '/src'),
},
proxy: {
'/': 'http://localhost:3000'
},
compress: true,
port: 8080,
},
};