Skip to content

Dev webserver fails to start on nixos (broken Pipe, esbuild goroutines) #549

@Elec3137

Description

@Elec3137

Describe the bug

Mostly, pnpm run dev doesn't work, forcing me to iterate on the app by doing:
pnpm run build && python -m http.server -d dist/

(within nix shell nixpkgs#nodejs nixpkgs#pnpm and after running pnpm i)

output of `pnpm run dev`
> sable@1.12.3 dev /mnt/data/projects/forks/Sable
> vite dev

10:24:05 PM [vite] (client) Forced re-optimization of dependencies

  VITE v7.3.1  ready in 1002 ms

  ➜  Local:   http://localhost:8080/
  ➜  Network: http://192.168.1.116:8080/
  ➜  Network: http://10.42.0.1:8080/
  ➜  press h + enter to show help
[vite-plugin-static-copy] Collected 10 items.
node:internal/process/promises:394
    triggerUncaughtException(err, true /* fromPromise */);
    ^

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:570:12)
    at _write (node:internal/streams/writable:499:10)
    at Writable.write (node:internal/streams/writable:508:10)
    at Runtime.updateConfig (/mnt/data/projects/forks/Sable/node_modules/.pnpm/miniflare@4.20260310.0/node_modules/miniflare/dist/src/index.js:63901:26)
    at async #assembleAndUpdateConfig (/mnt/data/projects/forks/Sable/node_modules/.pnpm/miniflare@4.20260310.0/node_modules/miniflare/dist/src/index.js:82566:30)
    at async Mutex.runWith (/mnt/data/projects/forks/Sable/node_modules/.pnpm/miniflare@4.20260310.0/node_modules/miniflare/dist/src/index.js:52466:48) {
  errno: -32,
  code: 'EPIPE',
  syscall: 'write'
}

Node.js v24.14.0
 ELIFECYCLE  Command failed with exit code 1.
And sometimes, a resulting error is also printed
sable > fatal error: all goroutines are asleep - deadlock!

goroutine 1 [chan receive]:
github.com/evanw/esbuild/internal/helpers.(*ThreadSafeWaitGroup).Wait(...)
	github.com/evanw/esbuild/internal/helpers/waitgroup.go:36
main.runService.func2()
	github.com/evanw/esbuild/cmd/esbuild/service.go:114 +0x53
main.runService(0x1)
	github.com/evanw/esbuild/cmd/esbuild/service.go:160 +0x4c3
main.main()
	github.com/evanw/esbuild/cmd/esbuild/main.go:252 +0xb75

goroutine 19 [chan receive]:
main.runService.func1()
	github.com/evanw/esbuild/cmd/esbuild/service.go:98 +0x45
created by main.runService in goroutine 1
	github.com/evanw/esbuild/cmd/esbuild/service.go:97 +0x1ce

goroutine 20 [chan receive]:
main.(*serviceType).sendRequest(0xc000194ea0, {0x9f48c0, 0xc0003be270})
	github.com/evanw/esbuild/cmd/esbuild/service.go:192 +0x12b
main.runService.func3()
	github.com/evanw/esbuild/cmd/esbuild/service.go:125 +0x3e
created by main.runService in goroutine 1
	github.com/evanw/esbuild/cmd/esbuild/service.go:122 +0x2d0

goroutine 107 [chan send]:
github.com/evanw/esbuild/internal/bundler.ScanBundle.func2()
	github.com/evanw/esbuild/internal/bundler/bundler.go:1425 +0x2c5
created by github.com/evanw/esbuild/internal/bundler.ScanBundle in goroutine 125
	github.com/evanw/esbuild/internal/bundler/bundler.go:1423 +0x97d

goroutine 125 [sync.WaitGroup.Wait]:
sync.runtime_SemacquireWaitGroup(0xc00039c060?, 0x80?)
	runtime/sema.go:114 +0x2e
sync.(*WaitGroup).Wait(0xc000404060)
	sync/waitgroup.go:206 +0x85
github.com/evanw/esbuild/internal/bundler.(*scanner).preprocessInjectedFiles(0xc000184d88)
	github.com/evanw/esbuild/internal/bundler/bundler.go:1802 +0xc32
github.com/evanw/esbuild/internal/bundler.ScanBundle(_, {_, _, _, _, _, _}, {_, _}, 0xc0002003c0, ...)
	github.com/evanw/esbuild/internal/bundler/bundler.go:1493 +0xb46
github.com/evanw/esbuild/pkg/api.rebuildImpl({0xc0002003c0, {0xc000126b40, 0x1, 0x1}, {0x0, 0x0, 0x0}, {0x0, 0x1, 0x2, ...}, ...}, ...)
	github.com/evanw/esbuild/pkg/api/api_impl.go:1493 +0x2c6
github.com/evanw/esbuild/pkg/api.(*internalContext).rebuild(_)
	github.com/evanw/esbuild/pkg/api/api_impl.go:1007 +0x27d
github.com/evanw/esbuild/pkg/api.(*internalContext).Rebuild(0x0?)
	github.com/evanw/esbuild/pkg/api/api_impl.go:1068 +0x45
main.(*serviceType).handleIncomingPacket.func5()
	github.com/evanw/esbuild/cmd/esbuild/service.go:293 +0xba
created by main.(*serviceType).handleIncomingPacket in goroutine 1
	github.com/evanw/esbuild/cmd/esbuild/service.go:290 +0x11d2

goroutine 130 [chan receive]:
main.(*serviceType).sendRequest(0xc000194ea0, {0x9f48c0, 0xc00039c300})
	github.com/evanw/esbuild/cmd/esbuild/service.go:192 +0x12b
main.(*serviceType).convertPlugins.func2.3({{0xc0003f4689, 0xbe}, {0x0, 0x0}, {0x0, 0x0}, {0xc00003e340, 0x1e}, 0x1, {0x0, ...}, ...})
	github.com/evanw/esbuild/cmd/esbuild/service.go:997 +0x97a
github.com/evanw/esbuild/pkg/api.(*pluginImpl).onResolve.func1({{0xc0003f4689, 0xbe}, {0xc00003e340, 0x1e}, {0x0, 0x0}, {{0x0, 0x0}, {0x0, 0x0}, ...}, ...})
	github.com/evanw/esbuild/pkg/api/api_impl.go:1937 +0x215
github.com/evanw/esbuild/internal/bundler.RunOnResolvePlugins({_, _, _}, _, {0xc000296000, 0xc00068c060, 0xc00068c0a8, 0xc000490300, 0x6, 0xc000610bd0}, ...)
	github.com/evanw/esbuild/internal/bundler/bundler.go:1085 +0x8d5
github.com/evanw/esbuild/internal/bundler.(*scanner).preprocessInjectedFiles.func2(0x0, {0xc0003f4689, 0xbe})
	github.com/evanw/esbuild/internal/bundler/bundler.go:1774 +0x63b
created by github.com/evanw/esbuild/internal/bundler.(*scanner).preprocessInjectedFiles in goroutine 125
	github.com/evanw/esbuild/internal/bundler/bundler.go:1752 +0xac5

Reproduction

  1. use nixos
  2. make sure programs.nix-ld.enable = false;
  3. nix-shell -p nodejs pnpm --run "pnpm iinstall && pnpm run dev"

Expected behavior

dev server shouldn't crash

Platform and versions

  1. NixOS 26.05 (Yarara) x86_64 (rev: 6c9a78c09ff4d6c21d0319114873508a6ec01655)
  2. Chromium: 145.0.7632.159 (Official Build, ungoogled-chromium) (64-bit)
  3. rev: 7b76e27e8f914c78ef1dd7740b48b5d7526e5d93
  4. federated.nexus

Additional context

pnpm remove wrangler had no visible effect. Also tried rm -r dist/ .wrangler/ node-modules/, moving the project to /tmp, etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingbug/confirmedThis bug is confirmed to happen & reproduciblehelp wantedExtra attention is neededpriority/lowan issue of low priority

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions