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 am using ts-node with the --swc flag. I expect it to work. It works fine for me on SWC < 1.3.50
Actual Behavior
I tried upgrading to SWC >= 1.3.50 today and it caused ts-node to not work. I unfortunately did not see much useful output. If there is a way to get more useful output to fix this, I am happy to try it.
Steps to reproduce the problem
Upgrade to SWC >= 1.3.50
Minimal reproduction
Be on ts-node version 10.9.1 and SWC version 1.3.50 and try to use ts-node with the --swc flag.
I have same issue.
After changing the version of @swc/core@1.3.51, I encountered an error in --swc mode.
The cause of the error seems to be import a file that only exports types.
Since a file that only exports types does not generate a SourceMap file when using @swc/core@1.3.51.
So it seems that updateSourceMap throw error because undefined is given to JSON.parse. ref
I have confirmed that the error does not occur when passing {} instead of undefined.
I want to send PR, but I still can't think of how to write tests.
cspotcode
changed the title
SWC >= 1.3.50 seems to have introduced breaking issues with ts-node
@swc/core@1.3.51 does not return sourcemap for type-only files, causes error in updateSourceMapSep 14, 2023
Search Terms
SWC
Expected Behavior
I am using ts-node with the
--swc
flag. I expect it to work. It works fine for me on SWC < 1.3.50Actual Behavior
I tried upgrading to SWC >= 1.3.50 today and it caused ts-node to not work. I unfortunately did not see much useful output. If there is a way to get more useful output to fix this, I am happy to try it.
Steps to reproduce the problem
Upgrade to SWC >= 1.3.50
Minimal reproduction
Be on ts-node version
10.9.1
and SWC version1.3.50
and try to use ts-node with the--swc
flag.Specifications
The relevant part would be:
The text was updated successfully, but these errors were encountered: