$ swc index.js -o dist/swc.js
failed to load file
Caused by:
stream did not contain valid UTF-8
Error: Failed to compile 1 file with swc.
{
"env": {
"shippedProposals": true
},
"jsc": {
"parser": {
"syntax": "ecmascript",
"jsx": true
}
}
}
const c = /*#__PURE__*/React.createElement("img", {
alt: "caf\uFFFD"
}).props.alt;
console.log(c);
Describe the bug
Input code
Config
{ "env": { "shippedProposals": true }, "jsc": { "parser": { "syntax": "ecmascript", "jsx": true } } }Expected behavior
Like babel, run successfully: https://babeljs.io/repl/#?browsers=safari%2012&build=&builtIns=false&corejs=3.6&spec=false&loose=false&code_lz=MYewdgzgLgBMMF4YAoA8BLAtgcxgQwBsoEAiYPAMwEuSYB6APgEoA6ABwCcQ2IXCoA3ACghoSCAIBTFgRDZkwJsKA&debug=false&forceAllTransforms=false&shippedProposals=false&circleciRepo=&evaluate=false&fileSize=false&timeTravel=false&sourceType=module&lineWrap=true&presets=react&prettier=false&targets=&version=7.15.3&externalPlugins=&assumptions=%7B%7D
Version
The version of @swc/core: 1.2.82
Additional context
Add any other context about the problem here.
Context
Somewhat related to parcel-bundler/parcel#6764