broken unicode escape sequence in jsx
Closed this issue · 5 comments
scottbessler commented
Steps to reproduce
tsconfig.json
{
"compilerOptions": {
"outDir": "./dist",
"declaration": true,
"moduleResolution": "node",
"strict": true,
"skipLibCheck": true,
"jsx": "react-jsx"
}
}
repro.tsx
export const Repro = () => {
return (<div><span>⚠</span>
⚠
</div>)
}
Behavior with typescript@5.8
> tsc
> grep children dist/repro.js
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("span", { children: "\u26A0" }), "\u26A0"] }));
Behavior with tsgo
> tsgo
> grep children dist/repro.js
return (jsx_runtime_1.jsxs("div", { children: [jsx_runtime_1.jsx("span", { children: "\u26A0" }), "\uFFFD"] }));
Its worth noting that the issue happens with the unicode character on a line by itself but not when there is other stuff in the same line.
jakebailey commented
Probably related to #1701 but, why have you done this? 😭
scottbessler commented
Probably related to #1701 but, why have you done this? 😭
Its actually a CLI tool using Ink, and its a status icon. :)
jakebailey commented
I see, you're saying it's literally https://www.compart.com/en/unicode/U+26A0.
scottbessler commented
I see, you're saying it's literally https://www.compart.com/en/unicode/U+26A0.
Well, it happens to multiple characters, but yeah that was one of the literals I was using.
jakebailey commented
Yeah, it's just a bug then, this is a valid character so not sure where it's gone wrong.