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

"index out of range" error after upgrading to 0.7.9 or 0.7.10 #437

Closed
evanleck opened this issue Oct 6, 2020 · 3 comments
Closed

"index out of range" error after upgrading to 0.7.9 or 0.7.10 #437

evanleck opened this issue Oct 6, 2020 · 3 comments

Comments

@evanleck
Copy link

evanleck commented Oct 6, 2020

Running the same command that worked with 0.7.8 now fails after upgrading to 0.7.9 or 0.7.10 with this error:

panic: runtime error: index out of range [0] with length 0

goroutine 614 [running]:
github.com/evanw/esbuild/internal/renamer.(*MinifyRenamer).NameForSymbol(0xc0013d50e0, 0x49, 0x19, 0x0)
	/Users/evan/dev/esbuild/internal/renamer/renamer.go:121 +0x1e5
github.com/evanw/esbuild/internal/js_printer.(*printer).printSymbol(0xc0016da9c0, 0x49)
	/Users/evan/dev/esbuild/internal/js_printer/js_printer.go:704 +0x5c
github.com/evanw/esbuild/internal/js_printer.(*printer).printBinding(0xc0016da9c0, 0x10000c0000000e6, 0x775a60, 0xc0002142d0)
	/Users/evan/dev/esbuild/internal/js_printer/js_printer.go:714 +0x1fe5
github.com/evanw/esbuild/internal/js_printer.(*printer).printFnArgs(0xc0016da9c0, 0xc00022e5c0, 0x1, 0x1, 0x0)
	/Users/evan/dev/esbuild/internal/js_printer/js_printer.go:924 +0x273
github.com/evanw/esbuild/internal/js_printer.(*printer).printFn(0xc0016da9c0, 0xc0002142c0, 0xe5, 0xc00022e5c0, 0x1, 0x1, 0xec, 0xc000223400, 0x1, 0x1, ...)
	/Users/evan/dev/esbuild/internal/js_printer/js_printer.go:940 +0x65
github.com/evanw/esbuild/internal/js_printer.(*printer).printStmt(0xc0016da9c0, 0xd4, 0x776180, 0xc002f32f00)
	/Users/evan/dev/esbuild/internal/js_printer/js_printer.go:2352 +0x8e99
github.com/evanw/esbuild/internal/js_printer.Print(0x50000004d, 0x0, 0x10000010000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc0028ba480, ...)
	/Users/evan/dev/esbuild/internal/js_printer/js_printer.go:2978 +0x405
github.com/evanw/esbuild/internal/bundler.(*linkerContext).generateCodeForFileInChunkJS(0xc00079c460, 0x776340, 0xc0013d50e0, 0xc002f600f0, 0x49, 0x1, 0xc002a600e0, 0x9, 0x9, 0xf00000000, ...)
	/Users/evan/dev/esbuild/internal/bundler/linker.go:3042 +0xc90
created by github.com/evanw/esbuild/internal/bundler.(*chunkReprJS).generate
	/Users/evan/dev/esbuild/internal/bundler/linker.go:3208 +0x85e

This is the command I'm running, though I've truncated the list of entry points since there are 72 total:

pnpx esbuild --minify --sourcemap --bundle --format=esm --splitting --target=es2019 '--define:process.env.NODE_ENV="development"' --outdir=public/assets assets/scripts/sidenav.js assets/scripts/loads.create.js assets/scripts/help.js ...
@evanw
Copy link
Owner

evanw commented Oct 6, 2020

Thanks for reporting this, and sorry this is happening. I'd like to get this fixed ASAP. There haven't been many changes related to this code since 0.7.8. I suspect the fix for #421 may be related to this regression. This should be pretty easy to fix but I probably won't be able to fix it without a code sample that reproduces the problem, or at least more information about the code causing the error. Are you able to share a code sample that causes this problem?

@evanleck
Copy link
Author

evanleck commented Oct 6, 2020

No worries, things happen! Thanks for getting to back to me so quickly! Mind if I email you a zip with the files to reproduce the error? My JS that's producing the error isn't particularly sensitive but it's not open source.

@evanw
Copy link
Owner

evanw commented Oct 6, 2020

Yes, I don't mind. That works for me.

@evanw evanw closed this as completed in 048dea3 Oct 7, 2020
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

2 participants