You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use SWC in dozens of projects but bizarrely it has stopped working in just one. It fails to transpile JSX despite the correct JSX flag being present in the .swcrc file, again like dozens of other projects.
I think the easiest thing to do is to just clone the project and have a look. So:
I fixed the problem after opening this issue by pinning the @swc/core version to one I knew that worked, specifically 1.2.50. I then committed this change so this is the one you would have tried.
I have just tried to replicate the bug by cloning the repository again and doing the following:
npm install @swc/core@latest
However I now cannot replicate it either.
I also stupidly did not supply you with the exact SWC version when I opened this issue. Not the one in the package.json file but the actual one that got installed when I ran npm install. So now I guess we are stuck.
I did not imagine the bug, however. It seemed to be a case of SWC not reading the configuration file, or at least not reading it properly, because it was not compiling the JSX.
I will leave the issue closed. It is up to you if you want to pursue this any further. In a meantime I have pinned the version in all of my repositories, around fifty in all:
"@swc/core": "1.2.50"
At some later date I will un-pin it again and if the bug resurfaces then I will let you know.
Describe the bug
I use SWC in dozens of projects but bizarrely it has stopped working in just one. It fails to transpile JSX despite the correct JSX flag being present in the
.swcrc
file, again like dozens of other projects.I think the easiest thing to do is to just clone the project and have a look. So:
Then the usual:
And then just build:
I get errors like:
Clearly a problem with JSX.
Input code
Config
Playground link (or link to the minimal reproduction)
https://play.swc.rs/?version=1.3.100&code=H4sIAAAAAAAAAwtKTUwucfH31StKzUtJLdLg4lIAApuwzNRyfTsQRweIk%2FJTKoFqXHNSc1PzSrg0rbkAjfPNzzcAAAA%3D&config=H4sIAAAAAAAAA1WPSw7DIAwF9zkF8rrbdtE79BAWdSIifrKJVBTl7iUE0maH3xsz8jooBbNoeKq1PMsQkYX4nEsi2Sf8lARIOxTNJia49XaWvRrRCtVoOxpIyBOluiX3hoMNQajjLXPGmzH%2FC3VwkUnkCu4o%2BsnSVTc0JbjwXmrZDkk50qF%2FwA%2FqsvNjMPLqm4kXGrYvhlQioBQBAAA%3D
SWC Info output
No response
Expected behavior
It should transpile just fine!
Actual behavior
See above.
Version
"@swc/core": "^1.2.50"
Additional context
Note that in the playground link, if you toggle the JSX flag then you get the behaviour that I have outlined.
So the problem seems to be that SWC is ignoring the configuration file for some reason.
The text was updated successfully, but these errors were encountered: