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 prints in console [maybe the full] source code of a bundled JS app on console.error(error) of caught exceptions (WHY?), while node, ts-node & tsx work OK as expected (don't print it) #9629

Closed
supfiger opened this issue Mar 25, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@supfiger
Copy link

supfiger commented Mar 25, 2024

What version of Bun is running?

1.0.26+c75e768a6

What platform is your computer?

Linux 6.5.0-1016-gcp x86_64 unknown

What steps can reproduce the bug?

Below are the repro steps.

But first, an important thing:
I import an external package (e.g. react). It could be any other.
Of course the problem reproduces without large source code (your own or external libraries, like react).
But, to explicit reproduce the problem and see it exactly, for clarity, we need a relatively large codebase. The easiest and shortest way - import some package.

Reproducing:

  1. Go to https://replit.com/@supfiger/Bun-issue.
  2. "Fork & run" it.
  3. In terminal run:
    1. bun run build
    2. bun start:bun // THE ISSUE HERE. You will see the verbose output of the source code of the app
    3. bun start:tsx or bun start:node or bun start:ts-node // All of them work ok as expected

What is the expected behavior?

It should print in console only the error data, NOT an application source code.

What do you see instead?

Source code of an app in console.

Additional information

  • The same behavior not only in replit.com, but in a local computer as well.
  • The same behavior not only with console.error(), but with console.log() and maybe with other methods too.
@supfiger supfiger added the bug Something isn't working label Mar 25, 2024
@supfiger supfiger changed the title Bun prints in console [maybe the full] source code of a bundled JS app on console.error(error) of caught exceptions, while node, ts-node & tsx work OK Bun prints in console [maybe the full] source code of a bundled JS app on console.error(error) of caught exceptions (WHY?), while node, ts-node & tsx work OK as expected (don't print it) Mar 25, 2024
@supfiger supfiger changed the title Bun prints in console [maybe the full] source code of a bundled JS app on console.error(error) of caught exceptions (WHY?), while node, ts-node & tsx work OK as expected (don't print it) Bun prints in console [maybe the full] source code of a bundled JS app on console.error(error) of caught exceptions (WHY?), while node, ts-node & tsx work OK as expected (don't print it) Mar 25, 2024
@Jarred-Sumner
Copy link
Collaborator

This was fixed in Bun v1.1.1 (#9832)

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

2 participants