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

esbuild-wasm hangs on Node 23 #3951

Open
clemyan opened this issue Oct 25, 2024 · 1 comment
Open

esbuild-wasm hangs on Node 23 #3951

clemyan opened this issue Oct 25, 2024 · 1 comment

Comments

@clemyan
Copy link

clemyan commented Oct 25, 2024

Description

When building with esbuild-wasm using Node 23.0.0 and 23.1.0, Go panics and the process hangs indefinitely

panic: JavaScript error: Path is a directory: open returned ERR_FS_EISDIR (is a directory) C:\

goroutine 12 [running]:
syscall/js.Value.Call({{}, 0x7ff800010000000a, 0x180c038}, {0x98f4e, 0x4}, {0x199d2c0, 0x4, 0x6})
        syscall/js/js.go:443 +0x3b
syscall.fsCall({0x98f4e, 0x4}, {0x1815350, 0x3, 0x3})
        syscall/fs_js.go:533 +0xe
syscall.Open({0x19b1598, 0x3}, 0x0, 0x0)
        syscall/fs_js.go:86 +0x1c
os.open(...)
        os/file_open_unix.go:15
os.openFileNolog.func1()
        os/file_unix.go:279 +0x9
os.ignoringEINTR(...)
        os/file_posix.go:251
os.openFileNolog({0x19b1598, 0x3}, 0x0, 0x0)
        os/file_unix.go:278 +0x10
os.OpenFile({0x19b1598, 0x3}, 0x0, 0x0)
        os/file.go:385 +0x3
os.Open(...)
        os/file.go:365
github.com/evanw/esbuild/internal/fs.(*realFS).readdir(0x185c400, {0x19b1598, 0x3})
        github.com/evanw/esbuild/internal/fs/fs_real.go:353 +0x8
github.com/evanw/esbuild/internal/fs.(*realFS).ReadDirectory(0x185c400, {0x19b1598, 0x3})
        github.com/evanw/esbuild/internal/fs/fs_real.go:146 +0x7
github.com/evanw/esbuild/internal/fs.(*zipFS).ReadDirectory(0x18387a0, {0x19b1598, 0x3})
        github.com/evanw/esbuild/internal/fs/fs_zip.go:188 +0x10
github.com/evanw/esbuild/internal/resolver.resolverQuery.dirInfoUncached({0x1878d88, 0x19a5c70, 0x0, 0x0}, {0x19b1598, 0x3})
        github.com/evanw/esbuild/internal/resolver/resolver.go:1515 +0x10
github.com/evanw/esbuild/internal/resolver.resolverQuery.dirInfoCached({0x1878d88, 0x19a5c70, 0x0, 0x0}, {0x19b1598, 0x3})
        github.com/evanw/esbuild/internal/resolver/resolver.go:1142 +0xb
github.com/evanw/esbuild/internal/resolver.resolverQuery.dirInfoUncached({0x1878d88, 0x19a5c70, 0x0, 0x0}, {0x19b1590, 0x8})
        github.com/evanw/esbuild/internal/resolver/resolver.go:1506 +0xc
github.com/evanw/esbuild/internal/resolver.resolverQuery.dirInfoCached({0x1878d88, 0x19a5c70, 0x0, 0x0}, {0x19b1590, 0x8})
        github.com/evanw/esbuild/internal/resolver/resolver.go:1142 +0xb
github.com/evanw/esbuild/internal/resolver.resolverQuery.dirInfoUncached({0x1878d88, 0x19a5c70, 0x0, 0x0}, {0x19b1580, 0x10})
        github.com/evanw/esbuild/internal/resolver/resolver.go:1506 +0xc
github.com/evanw/esbuild/internal/resolver.resolverQuery.dirInfoCached({0x1878d88, 0x19a5c70, 0x0, 0x0}, {0x19b1580, 0x10})
        github.com/evanw/esbuild/internal/resolver/resolver.go:1142 +0xb
github.com/evanw/esbuild/internal/resolver.resolverQuery.dirInfoUncached({0x1878d88, 0x19a5c70, 0x0, 0x0}, {0x18862a0, 0x1a})
        github.com/evanw/esbuild/internal/resolver/resolver.go:1506 +0xc
github.com/evanw/esbuild/internal/resolver.resolverQuery.dirInfoCached({0x1878d88, 0x19a5c70, 0x0, 0x0}, {0x18862a0, 0x1a})
        github.com/evanw/esbuild/internal/resolver/resolver.go:1142 +0xb
github.com/evanw/esbuild/internal/resolver.resolverQuery.dirInfoUncached({0x1878d88, 0x19a5c70, 0x0, 0x0}, {0x1849110, 0x22})
        github.com/evanw/esbuild/internal/resolver/resolver.go:1506 +0xc
github.com/evanw/esbuild/internal/resolver.resolverQuery.dirInfoCached({0x1878d88, 0x19a5c70, 0x0, 0x0}, {0x1849110, 0x22})
        github.com/evanw/esbuild/internal/resolver/resolver.go:1142 +0xb
github.com/evanw/esbuild/internal/resolver.resolverQuery.dirInfoUncached({0x1878d88, 0x19a5c70, 0x0, 0x0}, {0x18490e0, 0x28})
        github.com/evanw/esbuild/internal/resolver/resolver.go:1506 +0xc
github.com/evanw/esbuild/internal/resolver.resolverQuery.dirInfoCached({0x1878d88, 0x19a5c70, 0x0, 0x0}, {0x18490e0, 0x28})
        github.com/evanw/esbuild/internal/resolver/resolver.go:1142 +0xb
github.com/evanw/esbuild/internal/resolver.resolverQuery.dirInfoUncached({0x1878d88, 0x19a5c70, 0x0, 0x0}, {0x1888600, 0x3c})
        github.com/evanw/esbuild/internal/resolver/resolver.go:1506 +0xc
github.com/evanw/esbuild/internal/resolver.resolverQuery.dirInfoCached({0x1878d88, 0x19a5c70, 0x0, 0x0}, {0x1888600, 0x3c})
        github.com/evanw/esbuild/internal/resolver/resolver.go:1142 +0xb
github.com/evanw/esbuild/internal/resolver.(*Resolver).Resolve(0x1878d88, {0x1888600, 0x3c}, {0x19b1560, 0x9}, 0x0)
        github.com/evanw/esbuild/internal/resolver/resolver.go:521 +0xe4
github.com/evanw/esbuild/internal/bundler.RunOnResolvePlugins({0x0, 0x0, 0x0}, 0x1878d88, {0x18b72d0, 0x180a5d0, 0x180a5e8, 0x1838540, 0x4, 0x18d2210}, ...)
        github.com/evanw/esbuild/internal/bundler/bundler.go:1008 +0xf
github.com/evanw/esbuild/internal/bundler.(*scanner).addEntryPoints.func1(0x0, {{0x19b1560, 0x9}, {0x0, 0x0}, 0x1})
        github.com/evanw/esbuild/internal/bundler/bundler.go:1817 +0x1c
created by github.com/evanw/esbuild/internal/bundler.(*scanner).addEntryPoints in goroutine 10
        github.com/evanw/esbuild/internal/bundler/bundler.go:1784 +0x90

Reproduction

// build.mjs
import { build } from 'esbuild-wasm';

build({
	entryPoints: ['main.ts'],
	bundle: true,
}).then(console.log)

// main.ts
export default 42

Additional information

When using Yarn PnP, the error message is different. Not sure if it is the same error or not

panic: <object>

goroutine 8 [running]:
syscall.mapJSError({{}, 0x7ff800010000007a, 0x19b15d0})
        syscall/fs_js.go:565 +0x1e
syscall.fsCall.func1({{}, 0x0, 0x0}, {0x1816dc0, 0x1, 0x1})
        syscall/fs_js.go:520 +0x7
syscall/js.handleEvent()
        syscall/js/func.go:100 +0x23
github-merge-queue bot pushed a commit to yarnpkg/berry that referenced this issue Oct 25, 2024
## What's the problem this PR addresses?

There are a number of issues affecting Node 23, causing our E2E suite
and performance benchmarks to fail since its release:

nodejs/node#54224 (comment)
evanw/esbuild#3951

## How did you fix it?

Drop down to Node 22 for those actions until the issues are cleared

## Checklist

<!--- Don't worry if you miss something, chores are automatically
tested. -->
<!--- This checklist exists to help you remember doing the chores when
you submit a PR. -->
<!--- Put an `x` in all the boxes that apply. -->
- [x] I have read the [Contributing
Guide](https://yarnpkg.com/advanced/contributing).

<!-- See
https://yarnpkg.com/advanced/contributing#preparing-your-pr-to-be-released
for more details. -->
<!-- Check with `yarn version check` and fix with `yarn version check
-i` -->
- [x] I have set the packages that need to be released for my changes to
be effective.

<!-- The "Testing chores" workflow validates that your PR follows our
guidelines. -->
<!-- If it doesn't pass, click on it to see details as to what your PR
might be missing. -->
- [x] I will check that all automated PR checks pass before the PR gets
reviewed.
github-merge-queue bot pushed a commit to yarnpkg/berry that referenced this issue Oct 25, 2024
## What's the problem this PR addresses?

There are a number of issues affecting Node 23, causing our E2E suite
and performance benchmarks to fail since its release:

nodejs/node#54224 (comment)
evanw/esbuild#3951

## How did you fix it?

Drop down to Node 22 for those actions until the issues are cleared

## Checklist

<!--- Don't worry if you miss something, chores are automatically
tested. -->
<!--- This checklist exists to help you remember doing the chores when
you submit a PR. -->
<!--- Put an `x` in all the boxes that apply. -->
- [x] I have read the [Contributing
Guide](https://yarnpkg.com/advanced/contributing).

<!-- See
https://yarnpkg.com/advanced/contributing#preparing-your-pr-to-be-released
for more details. -->
<!-- Check with `yarn version check` and fix with `yarn version check
-i` -->
- [x] I have set the packages that need to be released for my changes to
be effective.

<!-- The "Testing chores" workflow validates that your PR follows our
guidelines. -->
<!-- If it doesn't pass, click on it to see details as to what your PR
might be missing. -->
- [x] I will check that all automated PR checks pass before the PR gets
reviewed.
@merceyz
Copy link

merceyz commented Oct 25, 2024

git bisect points to nodejs/node@00b2f07 (nodejs/node#54160) which has a revert PR open at nodejs/node#55527.

I didn't look into why the process doesn't terminate though.

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