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

Macros crashes Bun when trying to compile using build --compile #4373

Closed
Vexcited opened this issue Aug 28, 2023 · 1 comment
Closed

Macros crashes Bun when trying to compile using build --compile #4373

Vexcited opened this issue Aug 28, 2023 · 1 comment
Labels
bug Something isn't working bundler Something to do with the bundler crash An issue that could cause a crash

Comments

@Vexcited
Copy link

What version of Bun is running?

0.8.1 16b4bf341acc0f4804f0b6bdf5298c180cd00366

What platform is your computer?

Linux 5.15.90.1-microsoft-standard-WSL2 x86_64 x86_64

What steps can reproduce the bug?

Make a macro to remove dead code on production build, for example:

./utils.ts

export const isDevelopment = () => process.env.NODE_ENV === "development";

./index.ts

import { isDevelopment } from "./utils" with { type: 'macro' };

if (isDevelopment()) {
  console.log("something only for development");
}

Finally, run bun build --compile --outfile ./bin ./index.ts

What is the expected behavior?

Have a binary in ./bin

What do you see instead?

$ bun build --compile --outfile ./bin ./src/index.ts
[0.01ms] ".env"
[1]    13286 IOT instruction  bun build --compile --outfile ./bin ./index.ts

Additional information

I am doing this because for some reason, I have an error with console.logs when running the Bun binary inside a service or in PM2.

Here's the output when doing pm2 logs for example...

image

If that shouldn't open, I can open another issue for this if needed.

@Vexcited Vexcited added the bug Something isn't working label Aug 28, 2023
@Electroid Electroid added crash An issue that could cause a crash bundler Something to do with the bundler labels Oct 27, 2023
@Jarred-Sumner
Copy link
Collaborator

Does not reproduce as of Bun v1.0.7

@Jarred-Sumner Jarred-Sumner closed this as not planned Won't fix, can't repro, duplicate, stale Aug 29, 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 bundler Something to do with the bundler crash An issue that could cause a crash
Projects
None yet
Development

No branches or pull requests

3 participants