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

Unicode variable names don't build #9695

Closed
GeorchW opened this issue May 4, 2024 · 1 comment
Closed

Unicode variable names don't build #9695

GeorchW opened this issue May 4, 2024 · 1 comment

Comments

@GeorchW
Copy link

GeorchW commented May 4, 2024

🐛 bug report

We have this library as a transitive dependency, and it won't build with parcel since it uses Unicode variable names. I can reduce the example to this:

let ü = "ü";
alert(ü);

Building this with parcel build example.js fails with this error code:

@parcel/optimizer-swc: Expected unicode escape

When starting with parcel example.js, the output in the dist folder contains these relevant lines:

let \xfc = "\xfc";
alert(\xfc);

The unicode is converted to escape sequences regardless of where it occurs in the source, which is not correct.

The bug prevents us from using Plotly with Parcel.

🎛 Configuration (.babelrc, package.json, cli command)

Clean reproduction in bash:

mkdir 2024-05-04-parcel-unicode-repro
cd 2024-05-04-parcel-unicode-repro
echo 'let ü = "ü"; alert(ü)' > repro.js
yarn add parcel
yarn run parcel build repro.js

The error message here is slightly different:

@parcel/optimizer-swc: `let` cannot be used as an identifier in strict mode

It goes away when renaming the ü to u though.

🌍 Your Environment

Software Version(s)
Parcel 2.12.0
Node 18.20.2
Yarn 1.22.19
OS Linux
@mischnic
Copy link
Member

mischnic commented May 5, 2024

Duplicate of #9607, this will be fixed with #9574

@mischnic mischnic closed this as not planned Won't fix, can't repro, duplicate, stale May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants