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

bun --print breaks all bun commands: maximum nested function level reached #16305

Open
LetianLi opened this issue Jan 10, 2025 · 0 comments
Open
Labels
bug Something isn't working cli Something to do with CLI arguments needs investigate Needs to be investigated to find the root cause

Comments

@LetianLi
Copy link

LetianLi commented Jan 10, 2025

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?

  1. First run the command bun --print "console.log()" to demonstrate that it prints "\n undefined" correctly.

  2. Run the following command:

bun --print "`Date: ${new Date().getMonth()}/${new Date().getDate()}/${new Date().getFullYear()}`"

From this point on, all Bun CLI commands will fail in this terminal session.

  1. Run any Bun command like bun --print "console.log()", or bun, or bun --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.

@LetianLi LetianLi added bug Something isn't working needs triage labels Jan 10, 2025
@RiskyMH RiskyMH added cli Something to do with CLI arguments needs investigate Needs to be investigated to find the root cause and removed needs triage labels Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cli Something to do with CLI arguments needs investigate Needs to be investigated to find the root cause
Projects
None yet
Development

No branches or pull requests

2 participants