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

Dynamic import() doesn't work with code splitting #272

Closed
egoist opened this issue Jul 19, 2020 · 0 comments
Closed

Dynamic import() doesn't work with code splitting #272

egoist opened this issue Jul 19, 2020 · 0 comments

Comments

@egoist
Copy link

egoist commented Jul 19, 2020

Repro:

// a.ts
import('./b')

// b.ts
export default 1

Run:

esbuild a.ts b.ts --format=esm  --outdir=dist --bundle --splitting

I got following error:

panic: Internal error

goroutine 1 [running]:
github.com/evanw/esbuild/internal/bundler.(*linkerContext).computeCrossChunkDependencies(0xc000284000, 0xc00019c4e0, 0x3, 0x3)
        /Users/evan/dev/esbuild/internal/bundler/linker.go:617 +0x19b1
github.com/evanw/esbuild/internal/bundler.(*linkerContext).link(0xc000284000, 0xc0000bc2a0, 0xc0000ac2c0, 0xc0000e2140)
        /Users/evan/dev/esbuild/internal/bundler/linker.go:469 +0xe1
github.com/evanw/esbuild/internal/bundler.(*Bundle).Compile(0xc0000c09a0, 0xc0000bc2a0, 0xc0000ac2c0, 0xc0000e2140, 0x100000001, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /Users/evan/dev/esbuild/internal/bundler/bundler.go:616 +0x3cf
github.com/evanw/esbuild/pkg/api.buildImpl(0x0, 0xa, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /Users/evan/dev/esbuild/pkg/api/api_impl.go:497 +0x10a6
github.com/evanw/esbuild/pkg/api.Build(...)
        /Users/evan/dev/esbuild/pkg/api/api.go:246
github.com/evanw/esbuild/pkg/cli.runImpl(0xc0000c0010, 0x6, 0x6, 0xc0000c08c0)
        /Users/evan/dev/esbuild/pkg/cli/cli_impl.go:478 +0x1b8
github.com/evanw/esbuild/pkg/cli.Run(...)
        /Users/evan/dev/esbuild/pkg/cli/cli.go:30
main.main.func1(0x0, 0x0, 0xc0000c0010, 0x6, 0x6, 0x0, 0x0, 0xc00011df20)
        /Users/evan/dev/esbuild/cmd/esbuild/main.go:172 +0x21f
main.main()
        /Users/evan/dev/esbuild/cmd/esbuild/main.go:174 +0x254
@evanw evanw closed this as completed in 45e33dd Jul 19, 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

1 participant