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

json imports bypass transpiler ascii transformation #13514

Closed
cvng opened this issue Aug 24, 2024 · 1 comment
Closed

json imports bypass transpiler ascii transformation #13514

cvng opened this issue Aug 24, 2024 · 1 comment
Assignees
Labels
bug Something isn't working bundler Something to do with the bundler transpiler parser || printer

Comments

@cvng
Copy link

cvng commented Aug 24, 2024

What version of Bun is running?

1.1.25-canary.3+1bac09488

What platform is your computer?

Darwin 23.6.0 arm64 arm

What steps can reproduce the bug?

➜ cat test.json 
{
  "aaa": "€"
}

➜ cat test.js
import { aaa } from './test.json';

console.log('€');
console.log(aaa);

➜ bun build --target=bun test.js
// @bun
// test.json
var aaa = "€";

// test.js
console.log("\u20AC");
console.log(aaa);

What is the expected behavior?

➜ bun build --target=bun test.js
// @bun
// test.json
var aaa = "\u20AC";

// test.js
console.log("\u20AC");
console.log(aaa);

What do you see instead?

➜ bun build --target=bun test.js
// @bun
// test.json
var aaa = "€";

// test.js
console.log("\u20AC");
console.log(aaa);

Additional information

reproduced by @evanwashere

@cvng cvng added bug Something isn't working needs triage labels Aug 24, 2024
@evanwashere evanwashere added transpiler parser || printer and removed needs triage labels Aug 24, 2024
@paperdave paperdave self-assigned this Aug 26, 2024
@paperdave paperdave added the bundler Something to do with the bundler label Aug 26, 2024
@paperdave
Copy link
Member

fixed by @snoglobe in #14168

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 transpiler parser || printer
Projects
None yet
Development

No branches or pull requests

3 participants