You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
❯ cd /tmp
❯ npm i esbuild fflate
added 3 packages, and audited 4 packages in 2s
found 0 vulnerabilities
❯ npm ls esbuild fflate
tmp@ /private/tmp
├── esbuild@0.17.8
└── fflate@0.7.4
❯ echo 'export { unzipSync } from "node_modules/fflate";' | esbuild --bundle --platform=neutral
✘ [ERROR] panic: runtime error: invalid memory address or nil pointer dereference (while parsing "<stdin>")
debug.Stack (runtime/debug/stack.go:24)
helpers.PrettyPrintedStack (internal/helpers/stack.go:9)
bundler.parseFile.func1 (internal/bundler/bundler.go:189)
panic (runtime/panic.go:884)
resolver.resolverQuery.loadAsMainField (internal/resolver/resolver.go:1818)
resolver.resolverQuery.loadAsFileOrDirectory (internal/resolver/resolver.go:1666)
resolver.(*Resolver).ProbeResolvePackageAsRelative (internal/resolver/resolver.go:606)
bundler.ResolveFailureErrorTextSuggestionNotes (internal/bundler/bundler.go:573)
bundler.parseFile (internal/bundler/bundler.go:428)
bundler.(*scanner).maybeParseFile (internal/bundler/bundler.go:1360)
1 error
This also happens in JS version:
constesbuild=require('esbuild');esbuild.build({stdin: {contents: 'export { unzipSync } from "node_modules/fflate";',},bundle: true,platform: 'neutral',});
Note this doesn't crash for from "fflate";from "./node_modules/fflate"; or any even from "node_modules" and from "node_modules/doesntexist". It only crashes when there's a a node_module path that exists on disk and the platform=neutral.
Also there's nothing wrong with fflate - I don't mean to pick on that package it's just the one I happened to poke at right now.
The text was updated successfully, but these errors were encountered:
Full reproduction from scratch:
This also happens in JS version:
Note this doesn't crash for
from "fflate";
from "./node_modules/fflate";
or any evenfrom "node_modules"
andfrom "node_modules/doesntexist"
. It only crashes when there's a a node_module path that exists on disk and theplatform=neutral
.Also there's nothing wrong with fflate - I don't mean to pick on that package it's just the one I happened to poke at right now.
The text was updated successfully, but these errors were encountered: