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

TypeError: this[kGetDollarZero] is not a function. in yargs when using bun build --compile #10536

Open
lgarron opened this issue Apr 26, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@lgarron
Copy link
Contributor

lgarron commented Apr 26, 2024

What version of Bun is running?

1.1.5+b257a3097

What platform is your computer?

Darwin 23.4.0 arm64 arm

What steps can reproduce the bug?

I found this while testing compilation on the source, but this is a simpler repro:

mkdir /tmp/repro && cd /tmp/repro
npm install [email protected] [email protected] # current latest versions

# Works
bun build --compile --target=bun-darwin-arm64 ./node_modules/cubing/dist/bin/order.js
./order 3x3x3 "R U R'"

# Works
bun build --compile --target=bun-darwin-arm64 ./node_modules/cubing/dist/bin/puzzle-geometry-bin.js
./puzzle-geometry-bin --ss 2x2x2

# Compiles but errors at runtime.
bun build --compile --target=bun-darwin-arm64 ./node_modules/cubing/dist/bin/scramble.js
./scramble 333

What is the expected behavior?

No error.

What do you see instead?

Error:

30674 |     __classPrivateFieldSet(this, _YargsInstance_shim, shim3, "f");
30675 |     __classPrivateFieldSet(this, _YargsInstance_processArgs, processArgs, "f");
30676 |     __classPrivateFieldSet(this, _YargsInstance_cwd, cwd, "f");
30677 |     __classPrivateFieldSet(this, _YargsInstance_parentRequire, parentRequire, "f");
30678 |     __classPrivateFieldSet(this, _YargsInstance_globalMiddleware, new GlobalMiddleware(this), "f");
30679 |     this.$0 = this[kGetDollarZero]();
                      ^
TypeError: this[kGetDollarZero] is not a function. (In 'this[kGetDollarZero]()', 'this[kGetDollarZero]' is undefined)
      at new YargsInstance (/$bunfs/root/scramble:30679:15)
      at /$bunfs/root/scramble:30619:19
      at /$bunfs/root/scramble:32191:18

Additional information

No response

@lgarron lgarron added the bug Something isn't working label Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant