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 doesn't correctly build import.meta.path #15994

Open
aquapi opened this issue Dec 26, 2024 · 1 comment
Open

Bun doesn't correctly build import.meta.path #15994

aquapi opened this issue Dec 26, 2024 · 1 comment
Labels
bug Something isn't working needs triage

Comments

@aquapi
Copy link
Contributor

aquapi commented Dec 26, 2024

What version of Bun is running?

1.1.42+50eec0025

What platform is your computer?

Linux 6.8.0-51-generic x86_64 x86_64

What steps can reproduce the bug?

Create a file named lib/a.js.

export const obj = { path: import.meta.path };

And another file main.js that import that file:

console.log((await import('./lib/a.js')).default.path);

And bundle it using Bun.build or the CLI to bundled.js.

Run the main.js and bundled.js file.

What is the expected behavior?

Both file should output:

/.../lib/a.js

What do you see instead?

bundled.js output:

/.../main.js

Additional information

I see import.meta.path kept as it is in the output so something should be wrong there.

@aquapi aquapi added bug Something isn't working needs triage labels Dec 26, 2024
@aquapi
Copy link
Contributor Author

aquapi commented Dec 26, 2024

Is this an issue with all bundlers?
I see the same behavior in esbuild as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

1 participant