question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

socket hang up when using file watchers

See original GitHub issue

Environment

Nuxt CLI v3.0.0-27419629.87eb7d0 RootDir: D:\develop\nuxt3-app Nuxt project info:


  • Operating System: Windows_NT
  • Node Version: v16.11.1
  • Nuxt Version: 3.0.0-27419629.87eb7d0
  • Package Manager: npm@8.0.0
  • Bundler: Vite
  • User Config: css, nitro, vue
  • Runtime Modules: -
  • Build Modules: -

Reproduction

  1. If using IntelliJ install the plugin “File Watchers” and add a watcher for SCSS files. May also work with other IDEs.
  2. Create a .scss-file (e.g. /assets/styles/main.scss)
  3. start Vite dev-server
  4. edit the created scss-file

Describe the bug

If using a file watcher for transpiling scss to css and then changing the scss, the watcher generates a new css file. When registering file changes (may be the change of the .scss file) Vite dev-server rebuilds its files and then the following error occurs.

I think the error occurs, because the filewatcher is writing the css-file while Vite dev-server tries to read it.

Additional context

No response

Logs

ERROR  [proxy] socket hang up

  at connResetException (node:internal/errors:691:14)
  at Socket.socketOnEnd (node:_http_client:471:23)
  at Socket.emit (node:events:402:35)
  at Socket.emit (node:domain:475:12)
  at endReadableNT (node:internal/streams/readable:1343:12)
  at processTicksAndRejections (node:internal/process/task_queues:83:21)

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:11
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

6reactions
4Kazelotcommented, Feb 22, 2022

I don’t use scss and also have this problem

2reactions
misaoncommented, Mar 31, 2022

I have had this problem since the first version of Nuxt 3 beta (with Vite). Basically, it can be fixed by a change (for example, by adding an empty space in the vue file) and it works again. But it’s quite annoying during development. In my team, the socket hang up is displayed several times an hour. Yuck … @danielroe @pi0 you have no idea where the problem may be? It would be great to get rid of this long-standing bug. Thanks for response!

My log output:

 ERROR  [proxy] socket hang up
 
   at connResetException (node:internal/errors:692:14)
   at Socket.socketOnEnd (node:_http_client:478:23)
   at Socket.emit (node:events:539:35)
   at Socket.emit (node:domain:475:12)
   at endReadableNT (node:internal/streams/readable:1345:12)
   at processTicksAndRejections (node:internal/process/task_queues:83:21)

Nuxt project info:

------------------------------
- Operating System: `Linux`
- Node Version:     `v17.8.0`
- Nuxt Version:     `3.0.0-27477996.646c2f6`
- Package Manager:  `yarn@3.2.0`
- Builder:          `vite`
- User Config:      `modules`
- Runtime Modules:  `normalizedModule()`, `normalizedModule()`
- Build Modules:    `-`
------------------------------
Read more comments on GitHub >

github_iconTop Results From Across the Web

Postman : socket hang up - Stack Overflow
Socket hang up, error is port related error. I am sharing my experience. When you use ... Are you using nodemon, or some...
Read more >
NodeJS - What does socket hang up actually mean - Edureka
Your answer​​ When you send a request to a distant server as a client and don't get a response in a timely manner....
Read more >
How to handle a socket hang up error in Node.js usually - Quora
Socket hang up error are usually errors when requests coming to your server are more than it can handle. This might be b...
Read more >
Socket hang up while taking CSV report - Kibana
But I get the socket hang up error in Kibana; which eventually leads to ... false xpack.watcher.enabled: false xpack.security.enabled: false ...
Read more >
Error when running exp publish: socket hang up - Expo Forums
RequestError: Error: socket hang up while after using "exp build:android" or ... inotify is the system that watchman (a file watcher made by ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found