ts-node: SWC: unknown field `noInterop`, expected `resolveFully`
Using “@swc/core”: “1.3.88”, there is error with noInterop
JSON: {"sourceMaps":true,"module":{"noInterop":false,"type":"es6","strictMode":true,"ignoreDynamic":false},"swcrc":false,"jsc":{"parser":{"syntax":"typescript","tsx":false,"dynamicImport":true,"importAssertions":true},"target":"es2015","transform":{"legacyDecorator":true,"react":{"throwIfNamespace":false,"useBuiltins":false}},"keepClassNames":false,"experimental":{"keepImportAssertions":true}}}
Caused by:
unknown field `noInterop`, expected `resolveFully` at line 1 column 391
Probably similar fix as: https://github.com/TypeStrong/ts-node/pull/2062
Might be related:
About this issue
- Original URL
- State: open
- Created 9 months ago
- Reactions: 18
- Comments: 17
Links to this issue
Commits related to this issue
- Lock swc version https://github.com/TypeStrong/ts-node/issues/2070 — committed to llun/blog by llun 9 months ago
- fix(jest-config): Removing @swc/core from dependencies downgrade @swc/core requirements due to https://github.com/TypeStrong/ts-node/issues/2070 update config generation — committed to aklesky/node-workspace by aklesky 9 months ago
- fix(jest-config): Removing @swc/core from dependencies (#177) downgrade @swc/core requirements due to https://github.com/TypeStrong/ts-node/issues/2070 update config generation — committed to aklesky/node-workspace by aklesky 9 months ago
just checked, @swc/core
1.3.82
workssame here, downgraded
@swc/core
to"1.3.82"
@cspotcode Friendly ping?
It looks like https://github.com/TypeStrong/ts-node/pull/2062 fixes this issue but there was no new release since July. Can you publish a new release to fix it ?
FYI: The latest @swc/core (at least ^1.3.94) no longer errors out on the unknown fields as the above issue has been resolved via https://github.com/swc-project/swc/pull/8163 🎉
If anybody doesn’t need any specific ts-node features, install the
@swc-node/register
package and replace ts-node with it according to the documentation:It does not work with the following versions either.
Bump as well!
The SWC should have released semver major to prevent breaking all ts-node consumers who use swc.
Workaround for me was to use resolutions and overrides in package.json to force downgrade of all transient dependencies of @swc/core until a ts-node can release with the update.
I agree that an update to ts-node is the most practical fix, but it kind of looks like swc broke backwards compatibility by throwing an error when it encounters a no-longer-supported option, when it should have silently ignored that option.
Why is
"noInterop":false
being treated any differently than not specifyingnoInterop
? Logically the outcome is the same, so it looks like an swc bug - it’s not ts-node’s fault that swc broke backwards-compatibilty.@RomainLanz do you know what version works?