netlify cli crashes when switching pages in a Vite/React app
Describe the bug
orion@orion-m4 www-portal % netlify dev ⬥ Injecting environment variable values for all scopes ⬥ Ignored general context env var: LANG (defined in process) ⬥ Injected project settings env vars: TARS_API_BASE_URL, TARS_API_KEY ⬥ Injected .env.local file env vars: HEALTH_TEST_API_KEY ⬥ Setting up local dev server
⬥ Starting Vite dev server
[email protected] dev vite
VITE v7.1.5 ready in 96 ms
➜ Local: http://localhost:8080/ ➜ Network: http://10.0.0.23:8080/ ✔ Vite dev server ready on port 8080
╭─────────────────────── ⬥ ────────────────────────╮ │ │ │ Local dev server ready: http://localhost:8888 │ │ │ ╰───────────────────────────────────────────────────╯
⬥ Loaded function config in Lambda compatibility mode (https://ntl.fyi/lambda-compat)
⬥ Loaded function ping in Lambda compatibility mode (https://ntl.fyi/lambda-compat)
⬥ Loaded function health in Lambda compatibility mode (https://ntl.fyi/lambda-compat)
⬥ Loaded function stream in Lambda compatibility mode (https://ntl.fyi/lambda-compat)
⬥ Loaded function route in Lambda compatibility mode (https://ntl.fyi/lambda-compat)
⬥ Loaded function metrics in Lambda compatibility mode (https://ntl.fyi/lambda-compat)
⬥ Loaded function status in Lambda compatibility mode (https://ntl.fyi/lambda-compat)
⬥ Loaded function single in Lambda compatibility mode (https://ntl.fyi/lambda-compat)
(node:5493) [DEP0060] DeprecationWarning: The util._extend API is deprecated. Please use Object.assign() instead.
(Use node --trace-deprecation ... to show where the warning was created)
› Error: Netlify CLI has terminated unexpectedly
This is a problem with the Netlify CLI, not with your application.
If you recently updated the CLI, consider reverting to an older version by running:
npm install -g netlify-cli@VERSION
You can use any version from https://ntl.fyi/cli-versions.
Please report this problem at https://ntl.fyi/cli-error including the error details below.
Error: write EPIPE at afterWriteDispatched (node:internal/stream_base_commons:159:15) at writeGeneric (node:internal/stream_base_commons:150:3) at Socket._writeGeneric (node:net:966:11) at Socket._write (node:net:978:8) at writeOrBuffer (node:internal/streams/writable:572:12) at _write (node:internal/streams/writable:501:10) at Socket.Writable.write (node:internal/streams/writable:510:10) at IncomingMessage.ondata (node:internal/streams/readable:1009:22) at IncomingMessage.emit (node:events:519:28) at addChunk (node:internal/streams/readable:561:12)
System: OS: macOS 15.6.1 CPU: (10) arm64 Apple M4 Binaries: Node: 22.19.0 - ~/.nvm/versions/node/v22.19.0/bin/node Yarn: 1.22.22 - /opt/homebrew/bin/yarn npm: 10.9.3 - ~/.nvm/versions/node/v22.19.0/bin/npm Browsers: Chrome: 140.0.7339.133 Safari: 18.6 npmGlobalPackages: netlify-cli: 23.5.1
Steps to reproduce
Sorry, but I can't send the code to reproduce.
Configuration
orion@orion-m4 www-portal % cat netlify.toml [build] publish = "dist" command = "npm run build"
[dev] port = 8888 targetPort = 8080 autoLaunch = false framework = "vite"
[[redirects]] from = "/" to = "REDACTED" status = 302 force = true
[[redirects]] from = "/*" to = "/index.html" status = 200
[functions] directory = "netlify/functions
Environment
orion@orion-m4 www-portal % npx envinfo --system --binaries --npmPackages netlify-cli --npmGlobalPackages netlify-cli Need to install the following packages: [email protected] Ok to proceed? (y) y
System: OS: macOS 15.6.1 CPU: (10) arm64 Apple M4 Memory: 414.91 MB / 16.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 22.19.0 - ~/.nvm/versions/node/v22.19.0/bin/node Yarn: 1.22.22 - /opt/homebrew/bin/yarn npm: 10.9.3 - ~/.nvm/versions/node/v22.19.0/bin/npm pnpm: 10.6.5 - /opt/homebrew/bin/pnpm npmGlobalPackages: netlify-cli: 23.5.1
orion@orion-m4 www-portal %