Skip to content

[WRONG] jsc.experimental.keepImportAssertions is experimental, explicitlyΒ #7923

@meabed

Description

@meabed

Describe the bug

The bug is described here: TypeStrong/ts-node#2056

With version 1.3.83, swc renames the experimental configuration option jsc.experimental.keepImportAssertions to jsc.experimental.keepImportAttributes as per #7914

Suggestion to keep other libraries working without so much failure:

  • Adding jsc.experimental wrong or non-supported keys shouldn't throw an error ( maybe warning )
  • Alias renamed keys to the new keys to it still backward compatible

The error during running ts-node:

Failed to deserialize buffer as swc::config::Options
JSON: {"sourceMaps":true,"module":{"noInterop":false,"type":"commonjs","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 `keepImportAssertions`, expected one of `plugins`, `keepImportAttributes`, `emitAssertForImportAttributes`, `cacheRoot`, `disableBuiltinTransformsForInternalTesting` at line 1 column 396

Input code

No response

Config

No response

Playground link

No response

SWC Info output

No response

Expected behavior

The build should be working normally

Actual behavior

No response

Version

1.3.83

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions