Parcel: Error: read ECONNRESET

Created on 17 Dec 2017  ·  25Comments  ·  Source: parcel-bundler/parcel

Hello, I am trying to get started with Parcel. I created an index.html file with an index.js and when I run

parcel index.html

localhost:1234 opens fine but as soon as I save the file the server stops and I get

events.js:136
      throw er; // Unhandled 'error' event
      ^

Error: read ECONNRESET
    at _errnoException (util.js:999:13)
    at TCP.onread (net.js:629:25)
Bug Confirmed Bug

Most helpful comment

Guys this resolved the problem

Just run:

npm i -D -E [email protected]

https://github.com/ionic-team/ionic-cli/issues/2921#issuecomment-352359738

All 25 comments

Is there any more errors on the bundler side?
Or is this the bundler side?
Could u specify in a bit more detail what you did/fill in the bug report form, so we can reproduce this issue and debug it

It seems an issue of [email protected], downgrade and lock [email protected] works to me.

Related: https://github.com/lc60005457/parcel-plugin-vue/issues/4#issuecomment-352253498

Thanks for looking into this, i'll dive into this a bit and report what i found or do a PR

EDIT: Confirmed using WS 3.3.3

Pinpointed the situation, it had to do with an error that got added to ws (when user disconnects while sending), This gets triggered every time the websocket triggers a html reload (if u edit a html file)
I'll do a PR with a bugfix in a bit

Am I wrong or does this bug completely break Parcel in dev at the moment? Wanted to get check out Parcel today but crashes on every change.

It breaks the moment you change html files @chasegiunta

For me, it's breaking just upon reloading a page that is including the output. No html file change needed.

I'm running parcel src/main.js -d web/dist, and including only <script src="/dist/main.js"></script> on my page.

Than it's affecting more people than expected, i'll do my best to speedup getting the PR through

So, I landed here because I was googling the same today's error output (ionic project) https://github.com/ionic-team/ionic-cli/issues/2921

@DeMoorJasper are you facing that issue only with Chrome too?
Did you find any lead to solve it? something linked with websocket?

@peterpeterparker look at PR #320
It had to do with page reloads disconnecting the client websocket from the server, which resulted in ECONNRESET, it used to be ignored in WS 3.3.2 that's why it just became an error after the update...

@DeMoorJasper neat, thx for pointing that out 👍

I'm hear to report I'm having a very similar issue. I can start the parcel server, but I see this when it is starting...

yarn run v1.3.2
$ parcel -p 3000 ./public/index.html
⏳  Building...
Server running at http://localhost:3000 - configured port 3000 could not be used.

However, when I go to http://localhost:3000, the app responds. If I change any files, I see the changes happen. The second I refresh the page though, I get...

events.js:183
throw er; // Unhandled 'error' event
^

Error: read ECONNRESET
at _errnoException (util.js:1024:11)
at TCP.onread (net.js:615:25)
error Command failed with exit code 1.

Downgrading ws to 3.3.2 does not fix the problem.

@goyney This will be fixed once PR #320 lands

@goyney Are you sure you've downgraded ws successfully? Check package-lock.json or yarn.lock to confirm that.

And I'm using resolutions of yarn to lock ws version, it really works to me.

https://github.com/JounQin/parcel-study/blob/master/package.json

@JounQin hello,Can the downgrade ws to @3.3.2 solve the problem?

@wangjian1119 I solve this problem by locking [email protected] for now with yarn resolutions

https://github.com/JounQin/parcel-study/blob/master/package.json#L70

You can just try it.

Guys this resolved the problem

Just run:

npm i -D -E [email protected]

https://github.com/ionic-team/ionic-cli/issues/2921#issuecomment-352359738

@DeeJayElly your solution work for me thanks;

Not using chrome or disabling hmr should also work, as far as l’ve read other issues related to this one

@DeeJayElly thanks!This is a good way of resolution

hmmm @DeeJayElly solution is not working for me. Parcel still crashed when I manually reload the page. I'm using the latest Chrome and [email protected]. It's working fine in Safari though.

EDIT: it seems HMR is working normally and doesn't trigger the crash so everything is okay as long as I don't reload the page manually.

Fix pushed in v1.2.1.

@devongovett I can confirm this push fixes the issue for me. Cheers

`wss.on('connection', function (ws) {
ws.on('error', function (msg) { //must
console.log(msg)
})
ws.on('close', function (msg) { //must
console.log(msg)
})

})`

Try to install parcel locally

Was this page helpful?
0 / 5 - 0 ratings