Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime panic on unsuccessful build with --analyze #3834

Closed
HanabishiRecca opened this issue Jul 14, 2024 · 0 comments
Closed

Runtime panic on unsuccessful build with --analyze #3834

HanabishiRecca opened this issue Jul 14, 2024 · 0 comments

Comments

@HanabishiRecca
Copy link

Esbuild panics in runtime if build is not successful and --analyze is enabled.

Basically just invoke esbuild --analyze without any additional args.

$ npx esbuild --analyze                                                                                                                                                                                                                    1 
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x2f8 pc=0x8e0e18]

goroutine 1 [running]:
github.com/evanw/esbuild/pkg/cli.addAnalyzePlugin(...)
	github.com/evanw/esbuild/pkg/cli/cli_impl.go:1112
github.com/evanw/esbuild/pkg/cli.runImpl({0xc000022050, 0x1, 0x1}, {0xc0000e7dd8, 0x0, 0xee0041000a5e90?})
	github.com/evanw/esbuild/pkg/cli/cli_impl.go:1156 +0x598
github.com/evanw/esbuild/pkg/cli.Run(...)
	github.com/evanw/esbuild/pkg/cli/cli.go:31
main.main.func1({0x0?, 0xc000036030?}, {0xc000022050, 0x1, 0x1}, {0x0?, 0xc0000706d8?}, {0x0, 0x0}, 0xc0000e7eb0, ...)
	github.com/evanw/esbuild/cmd/esbuild/main.go:366 +0x510
main.main()
	github.com/evanw/esbuild/cmd/esbuild/main.go:368 +0x9bc
node:child_process:928
    throw err;
    ^

Error: Command failed: /tmp/new/node_modules/@esbuild/linux-x64/bin/esbuild --analyze
    at genericNodeError (node:internal/errors:983:15)
    at wrappedFn (node:internal/errors:537:14)
    at checkExecSyncError (node:child_process:889:11)
    at Object.execFileSync (node:child_process:925:15)
    at Object.<anonymous> (/tmp/new/node_modules/esbuild/bin/esbuild:220:28)
    at Module._compile (node:internal/modules/cjs/loader:1467:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1551:10)
    at Module.load (node:internal/modules/cjs/loader:1282:32)
    at Module._load (node:internal/modules/cjs/loader:1098:12)
    at TracingChannel.traceSync (node:diagnostics_channel:315:14) {
  status: 2,
  signal: null,
  output: [ null, null, null ],
  pid: 45,
  stdout: null,
  stderr: null
}

Node.js v22.4.1

Linux x86-64
Node.js 22.4.1
esbuild 0.23.0

@evanw evanw closed this as completed in 892d2a7 Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant