Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

231
Visualizações
Getting Websocket Error But Not Using Websockets in Code

I keep getting this websocket error when I run npm run dev. I'm working in a group of WSL and Mac users and our repo all works for them but I'm the only that gets this issue when trying to run our application. At a loss for why this is happening.

Websocket Error when running npm run dev

This is our webpack configuration file.

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/
          },
          {
            //npm install -D sass-loader css-loader style-loader webpack
            // /\.s[ac]ss$/i
            // /\.css /
            test: /\.s?css/,
            use: ["style-loader", "css-loader", "sass-loader"
            ],
          },
          {
            // Now we apply rule for images
            test: /\.(png|jpg|gif|svg)$/,
            use: [
              {
                // Using file-loader for these files
                loader: "file-loader",
                // loader: "url-loader",
                // In options we can set different things like format
                // and directory to save
                options: {
                  outputPath: '/images'
                }
              }
            ]
          },
          // {
          //   test: /\.(png|jpg)$/,
          //   loader: 'url-loader'
          // },
        ]
    },
    resolve: {
        // Enable importing JS / JSX files without specifying their extension
        extensions: [".js", ".jsx", ".tsx", ".ts"],
    },
    devServer: {
      static: {
        directory: path.join(__dirname, '/src'),
        },
      proxy: {
        '/': 'http://localhost:3000'
      },
      compress: true,
      port: 8080,
  },
};

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Found the answer / a working solution. I changed the port from 8080 in our devServer to 9000 and it worked, I'm not sure why that worked but it did. I also found this a recommended solution in the snowpack.dev docs that say to do the same thing. https://www.snowpack.dev/reference/common-error-details

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda