cli icon indicating copy to clipboard operation
cli copied to clipboard

netlify dev crashes with error: "Segmentation Fault / maxBuffer exceeded. Shutting down Netlify Dev server"

Open webdevsk opened this issue 2 years ago • 0 comments

Describe the bug

Project: React + Vite + Netlify functions v2 My system: Windows 11 Professional | Ryzen 5 4600H 6C12T | 16GB DDR4 Ram Node: v20.10.0 CLI: v17.10.0 + 2 older versions Vite: v4.4.5 npm: v10.2.3

Netlify dev crashes after several minutes with just a single message "Segmentation fault" and nothing else. When I run netlify dev --debug, I get "maxBuffer exceeded. Shutting down Netlify Dev server" instead. I've attached the full error below.

Note: I have several Netlify functions but only 1 gets called repeatedly while I'm working in dev mode. I have noticed that most of the time it crashes upon calling a Netlify function.

Problem persisted in the last 3 Netlify cli versions including the current one being v17.10.0 I haven't tried older versions fearing that Functions v2 may not work.

All functions use Prisma to make Database queries and this is the schema:

generator client {
  provider      = "prisma-client-js"
  binaryTargets = ["native", "windows", "rhel-openssl-1.0.x"]
}

Full error message:

 »   Warning: 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.     
 »
 »       at error (file:///(.....omitted.....)/AppData/Roaming/npm/node_modules/netlify-cli/src/utils/command-helpers.js:174:19)
 »       at process.<anonymous> (file:///(....omitted....)/AppData/Roaming/npm/node_modules/netlify-cli/src/commands/main.js:41:5)
 »       at process.emit (node:events:526:35)
 »       at process.emit (node:domain:488:12)
 »       at process._fatalException (node:internal/process/execution:178:25)
◈ Command failed: npm run dev
maxBuffer exceeded. Shutting down Netlify Dev server

Steps to reproduce

netlify dev --debug

Configuration

[build] functions = "serverless/" [dev] targetPort = 3000 [functions] directory = "serverless/" node_bundler = "esbuild" [[redirects]] from = "/*" to = "/index.html" status = 200

Environment

System: OS: Windows 11 10.0.23595 CPU: (12) x64 AMD Ryzen 5 4600H with Radeon Graphics Memory: 6.23 GB / 15.87 GB Binaries: Node: 20.10.0 - C:\Program Files\nodejs\node.EXE npm: 10.2.3 - C:\Program Files\nodejs\npm.CMD

webdevsk avatar Dec 07 '23 12:12 webdevsk