Skip to content

Netlify dev server crashes upon saving code changes #5917

@fadingbeat

Description

@fadingbeat

Describe the bug

If development server is running and I create a change in the code, upon saving those changes the server crashes. It also crashes if I switch between Git branches. The instance of application is running in the browser constantly. There are a couple of scenarios I've noticed this happening.

Steps to reproduce

Using VS Code
Using Netlify serverless functions

Scenarion 1:

1. Run `netlify dev`
2. App is started in the browser, everything works as expected
3. Change something in the code and save it
4. Dev server crashes with message `res.writeHead is not a function`

Scenario 2:

1. Run `netlify dev `
2. App is started in the browser, everything works as expected
3. Commit changes
4. Switch between branches
5. Dev server crashes with message `res.writeHead is not a function`

Scenario 3:

1. Netlify server running
2. Change CSS styles
3. Server crashes
4. Run `netlify dev`
5. Reload browser
6. Server crashes
TypeError: res.writeHead is not a function
		    at ProxyServer.<anonymous> (file:///C:/Development/color-healing/node_modules/netlify-cli/src/utils/proxy.mjs:362:9)
		    at ProxyServer.emit (C:\Development\color-healing\node_modules\netlify-cli\node_modules\eventemitter3\index.js:204:33)
		    at Socket.onOutgoingError (C:\Development\color-healing\node_modules\netlify-cli\node_modules\http-proxy\lib\http-proxy\passes\ws-incoming.js:157:16)  
		    at Socket.emit (node:events:524:35)
		    at Socket.emit (node:domain:489:12)
		    at emitErrorNT (node:internal/streams/destroy:151:8)
		    at emitErrorCloseNT (node:internal/streams/destroy:116:3)
		    at processTicksAndRejections (node:internal/process/task_queues:82:21)
		
		Node.js v19.6.0
		fatal error: all goroutines are asleep - deadlock!

Configuration

[build]
  command = "npm run build"
  functions = "functions"
  publish = "dist/color-healing"
[functions]
  node_bundler = "esbuild"
[dev]
  autoLaunch = false
[[redirects]]
  from = "/*"
  to = "/"
  status = 200

Environment

System:
    OS: Windows 10 10.0.19045
    CPU: (4) x64 AMD A10-7300 Radeon R6, 10 Compute Cores 4C+6G
    Memory: 4.16 GB / 9.95 GB
  Binaries:
    Node: 19.6.0 - C:\Program Files\nodejs\node.EXE
    npm: 9.4.0 - C:\Program Files\nodejs\npm.CMD
  npmPackages:
    netlify-cli: 15.1.0 => 15.1.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugcode to address defects in shipped code

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions