bun --print breaks all bun commands: maximum nested function level reached #16305
Labels
bug
Something isn't working
cli
Something to do with CLI arguments
needs investigate
Needs to be investigated to find the root cause
What version of Bun is running?
1.1.43+76800b049
What platform is your computer?
Darwin 24.1.0 arm64 arm
What steps can reproduce the bug?
First run the command
bun --print "console.log()"
to demonstrate that it prints "\n undefined" correctly.Run the following command:
From this point on, all Bun CLI commands will fail in this terminal session.
bun --print "console.log()"
, orbun
, orbun --revision
.What is the expected behavior?
It should return a better error if there was one.
It should not cause every bun command to fail.
What do you see instead?
Step 2 causes the process to spam "const:18: bad substitution" and end in "const:18: maximum nested function level reached; increase FUNCNEST?"
Step 3 on any bun command spams "const:19: bad substitution" and ends in "const:19: maximum nested function level reached; increase FUNCNEST?"
Any further bun commands repeats the spam with the (I assume) line number incrementing every single time.
Additional information
If
bun --eval
is used in step 2, it immediately exits without spam showing "zsh: bad substitution" and the usage menu (expected).The command in step 2 was unintentionally malformed, the correct command which works is to replace
"
with'
, or to escape the dollar signs. I did not know what bad substitution was until I looked it up today.The text was updated successfully, but these errors were encountered: