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
{{ message }}
Repository navigation
Support ES2023 and ES2024 targets when using SWC #2160
SWC since version 1.8.0 (2024-11-04) supports ES2023 and ES2024
Once using ts-node with swc having a target equals to ES2023 or ES2024 the application should execute correctly
Actual Behavior
The application fails with error:
return bindings.transformSync(isModule ? JSON.stringify(src) : src, isModule, toBuffer(newOptions));
^
Error: x jsc.target should be es5 or upper to use getter / setter
Steps to reproduce the problem
In a project using ts-node with swc set the target to ES2023 or ES2024 and it will fail. Once you set the target as ES2022 the project work as expected.
@cspotcode I've opened a PR resolving this issue, but I would also like to propose that instead of automatically downgrading the target to ES3 in this line we should raise an exception letting the user know that the specified target is not currently supported.
Activity
felipeplets commentedon May 1, 2025
@cspotcode I've opened a PR resolving this issue, but I would also like to propose that instead of automatically downgrading the target to ES3 in this line we should raise an exception letting the user know that the specified target is not currently supported.
tianyingchun commentedon Jun 1, 2025
it seems that
ts-nodehave no activity over 1year. maybe we need to switch it toswcsee here. https://github.com/hyperse-io/ts-node
wenerme commentedon Jul 14, 2025
Workaround for now
put this to
patches/ts-node.patchadd this to
pnpm-workspace.yamlthen