oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
74.49k stars 2.79k forks source link

Throwing inside the bun repl can cause it to exit #8375

Open glensc opened 10 months ago

glensc commented 10 months ago

What version of Bun is running?

1.0.25

What platform is your computer?

Darwin 23.2.0 arm64 arm

What steps can reproduce the bug?

$ bun repl
> import { $ } from "bun";

> await $`echo "xxx"`.json();
 7 |     }
 8 |   }
 9 |   var setup = () => {
10 |     const { FixedQueue } = @getInternalField(@internalModuleRegistry, 3) || @createInternalModuleById(3);
11 |     queue = new FixedQueue;
- |     function processTicksAndRejections() {
SyntaxError: JSON Parse error: Unexpected identifier "xxx"

also, this crashes bun repl:

> await $$
1 | (async()=>{"use strict";void 0;
2 | return await $$;;})();
                 ^
ReferenceError: Can't find variable: $$

What is the expected behavior?

it should not crash bun repl

What do you see instead?

No response

Additional information

No response

philosofonusus commented 9 months ago

I receive the same issue bun 1.0.29

BRAVO68WEB commented 3 months ago

Any reason why does this happens?

I got it in bun v1.1.22

gengue commented 3 months ago

I have the same issue with my cli app (bun v1.1.26) but using fetch to an external API after building it as a binary.