-
Notifications
You must be signed in to change notification settings - Fork 12
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
[Bug] 2.0.0 Errors when components contain multi-byte characters (e.g. emoji) 💩 (not always, though) #191
Comments
I have a reproduction of this and I'm digging into the code. It seems like
|
With slice, on't you need to -1 with the end index? Or do end-start? Something was length based, yeah? |
I don't think that's the case. I have lots of tests for similar component code and they all work. If I try Speaking of emojis, here's the minimal repro 😂 😂 😂 import Component from '@glimmer/component';
class MyComponent extends Component {
<template>
💩
</template>
} I opened embroider-build/content-tag#45 since I think the fix lives there. |
I think the fix could still be here depending on discussions from the meeting this upcoming Tuesday. We've since learned that Rust's indices are byte-indices , rather than character-indices |
I hit this bug on One example; test('it encodes login for URI', async function (assert) {
const student = make('student', {
firstName: 'first_name',
// login: 'abc다윤6', // THIS FAILS (even if remaining as a comment, any use of <template> after this line and prettier explodes)
login: 'abc\uB2E4\uC7246', // THIS WORKS
})
await render(<template><LoginCard @student={{student}} /></template>)
... Error
I also have an example of the same bug in a non-test GTS file, using the endash character. This also blows up in the same way get rows(): LessonGuideRow[] {
const guides = {
[Number]: '1–3',
[Fractions]: '1',
[Operations]: '1–6',
[Geometry]: '1–4',
[Measurement]: '1–5',
}
}
<template>...</template> Would you like a new issue opened? |
Thanks @gitKrystan I've added a failing test for it here #220 |
At this point I am waiting on either:
|
Hi, I have the same problem with certain French characters such as: |
I'd advise to stay on the latest 1.x for now if you are running into this issue. |
I have the same issue using the |
It seems like the problem is here: https://github.com/gitKrystan/prettier-plugin-ember-template-tag/blob/844a082f66b55ebd27f118584ef89ad8e94b90bc/src/parse/index.ts#L48-L55 The |
I just released v2.0.1 with @patricklx's fix (omgthankyou): https://github.com/gitKrystan/prettier-plugin-ember-template-tag/releases/tag/v2.0.1 Please let me know how it goes! |
🐞 Describe the Bug
I recieved a syntax error, even though I was not expecting one.
🔬 Minimal Reproduction
the file
😕 Actual Behavior
the error:
🤔 Expected Behavior
no error
🌍 Environment
➕ Additional Context
prettier 3.1
The text was updated successfully, but these errors were encountered: