Closed patricklafrance closed 1 year ago
strict
is not a valid option for ESM, as strict
does not have any meaning.
The only option valid for ESM is resolveFull: pool
#[serde(default)]
pub allow_top_level_this: bool,
#[serde(default)]
pub strict: bool,
#[serde(default = "default_strict_mode")]
pub strict_mode: bool,
#[serde(default)]
pub lazy: Lazy,
#[serde(default)]
pub import_interop: Option<ImportInterop>,
/// Emits `cjs-module-lexer` annotation
/// `cjs-module-lexer` is used in Node.js core for detecting the named
/// exports available when importing a CJS module into ESM.
/// swc will emit `cjs-module-lexer` detectable annotation with this option
/// enabled.
///
/// Defaults to `true` if import_interop is Node, else `false`
#[serde(default)]
pub export_interop_annotation: Option<bool>,
#[serde(default)]
/// Note: deprecated
pub no_interop: bool,
#[serde(default)]
pub ignore_dynamic: bool,
#[serde(default)]
pub preserve_import_meta: bool,
#[serde(default)]
pub resolve_fully: bool,
Thank you @kdy1 šš»
What exactly does resolveFully
do? I can't find anything on the documentation website.
I'm also getting this same error with version 1.3.86
. What is resolveFully
and why do I need it?
You don't need resolveFully
Remove wrong fields.
I don't have this field and it stills complaining about it. Here my .swcrc content and it works fine with 1.3.80
.
{
"sourceMaps": true,
"module": {
"type": "nodenext",
"strict": true,
"strictMode": true,
"noInterop": false
},
"jsc": {
"externalHelpers": true,
"target": "es2022",
"parser": {
"syntax": "typescript",
"tsx": false,
"decorators": true,
"dynamicImport": true
},
"transform": {
"legacyDecorator": true,
"decoratorMetadata": true
},
"keepClassNames": true
}
}
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Describe the bug
With
@swc/core
v1.3.85 I get the following error:If lower
@swc/core
version back to 1.3.84, the error goes away.Full stack:
Input code
Config
No response
Playground link
No response
SWC Info output
Expected behavior
No error.
Actual behavior
No response
Version
1.3.85
Additional context
The code is transpiled with the following stack:
webpack 5
->swc-loader
->swc/core