This document describes that are not a bug. If you file an issue that is described in this issue, the issue will be closed without any additional information.
Class fields are undefined
jest.mock of ESM fails / Cannot modify ES modules.
Evaluation order of module: "commonjs" is different from tsc.
The behavior of tsc is wrong. ESM is an established standard, and the specification explicitly says that ESM imports are hoisted.
Cyclic imports of ESM do not work (as what you want)
ESM is an established standard, and as SWC is a compiler, SWC always follows specifications.
I can't import CJS Modules from node.js ESM.
TDZ semantics is broken
This document describes that are not a bug. If you file an issue that is described in this issue, the issue will be closed without any additional information.
Class fields are
undefineduseDefineForClassFieldsbehavior #6985jest.mockof ESM fails / Cannot modify ES modules.jest.mockof ESM should fail, and it's correct #5205Evaluation order of
module: "commonjs"is different fromtsc.The behavior of
tscis wrong. ESM is an established standard, and the specification explicitly says that ESM imports are hoisted.Cyclic imports of ESM do not work (as what you want)
ESM is an established standard, and as SWC is a compiler, SWC always follows specifications.
I can't import CJS Modules from node.js ESM.
TDZ semantics is broken