Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Works with 3.11.0 but fails with 3.11.3 errno: -4077 ECONNRESET #4342

Closed
jchambers-ln opened this issue Mar 17, 2022 · 4 comments
Closed

Works with 3.11.0 but fails with 3.11.3 errno: -4077 ECONNRESET #4342

jchambers-ln opened this issue Mar 17, 2022 · 4 comments

Comments

@jchambers-ln
Copy link

jchambers-ln commented Mar 17, 2022

Bug report

Project starts and runs fine when on 3.11.0 but throws the below error on 3.11.3. I've looked and searched the usually places but can't seem to find an answer and the error doesn't give me much to go on.

Actual Behavior

Error: read ECONNRESET
at TCP.onStreamRead (internal/stream_base_commons.js:209:20)
Emitted 'error' event on Socket instance at:
at emitErrorNT (internal/streams/destroy.js:106:8)
at emitErrorCloseNT (internal/streams/destroy.js:74:3)
at processTicksAndRejections (internal/process/task_queues.js:82:21) {
errno: -4077,
code: 'ECONNRESET',
syscall: 'read'
}

Expected Behavior

to work

How Do We Reproduce?

Its a internal project so I can't put full example, I'm assuming its a compatibility issue but its a large old project.

Please paste the results of npx webpack-cli info here, and mention other relevant information

Here is the webpackDevServer.config.js I am using

'use strict';

const errorOverlayMiddleware = require('react-dev-utils/errorOverlayMiddleware');
const noopServiceWorkerMiddleware = require('react-dev-utils/noopServiceWorkerMiddleware');
const ignoredFiles = require('react-dev-utils/ignoredFiles');
const config = require('./webpack.config.dev');
const paths = require('./paths');

const protocol = process.env.HTTPS === 'true' ? 'https' : 'http';
const host = process.env.HOST || '0.0.0.0';

module.exports = function(allowedHost) {
  return {
    disableHostCheck:
    compress: true,
    clientLogLevel: 'none',
    contentBase: paths.appPublic,
    watchContentBase: true,
    hot: true,
    publicPath: config.output.publicPath,
    quiet: true,
    watchOptions: {
      ignored: ignoredFiles(paths.appSrc),
    },
    // Enable HTTPS if the HTTPS environment variable is set to 'true'
    https: protocol === 'https',
    host: host,
    overlay: false,
    historyApiFallback: {
      // Paths with dots should still use the history fallback.
      // See https://github.com/facebookincubator/create-react-app/issues/387.
      disableDotRule: true,
      rewrites: [
        { from: /^\/tools.html/, to: '/build/tools.html' },
      ]
    },

    public: allowedHost,
    before(app) {
      app.use(errorOverlayMiddleware());
      app.use(noopServiceWorkerMiddleware('/'));
    },
  };
};
@jchambers-ln
Copy link
Author

The only thing I've found here or elsewhere is this #1642 but its not 1:1.

@jchambers-ln
Copy link
Author

jchambers-ln commented Mar 17, 2022

It seems to start some times with the following changes

the start up script contains:

'use strict';

process.env.BABEL_ENV = 'production';
process.env.NODE_ENV = 'production';

// Makes the script crash on unhandled rejections instead of silently
// ignoring them. In the future, promise rejections that are not handled will
// terminate the Node.js process with a non-zero exit code.
process.on('unhandledRejection', err => {
  console.log(err);
  throw err;
});

Changing process.env.BABEL_ENV and process.env.NODE_ENV to development fixed it.

Closing the issue but maybe it will help someone else

@alexander-akait
Copy link
Member

Please update to v4, v3 deprecated

@jchambers-ln jchambers-ln changed the title Works with 3.11.2 but fails with 3.11.3 errno: -4077 ECONNRESET Works with 3.11.0 but fails with 3.11.3 errno: -4077 ECONNRESET Mar 18, 2022
@jchambers-ln
Copy link
Author

works better with npm 8.5.0 than it did with 8.3.0... ok btw https://www.npmjs.com/package/webpack-dev-server?msclkid=319717faa6c911ec85f7d53e805f59a4 still lists the 3x tree as current versions not depreciated.

I'll close the issue and see if I can get this working in v4 (I'm more of a Java developer so wepack is a google the answer and try it process for me)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants