ts-node
ts-node copied to clipboard
[ESM] [SWC] SyntaxError: The requested module '' does not provide an export named ''
Search Terms
esm,swc, interfaces
Expected Behavior
When exporting an interface, the ts-node crashes, however, this only happens when we provide --swc
option.
Actual Behavior
Crashes with the error: SyntaxError: The requested module './.js' does not provide an export named ''
Steps to reproduce the problem
- Create
fileA.ts
and export an interface there - Create
fileB.ts
and import and export the interface fromfileA.ts
Minimal reproduction
- FileA
export interface myType {
id: string;
}
- FileB
import { myType } from "./types.js";
export { myType } from "./types.js";
console.log("Hello World!");
Specifications
- ts-node version: v10.9.1
- node version: v18.14.0
- TypeScript version: 4.7.4
- tsconfig.json, if you're using one:
{}
- package.json:
{}
- Operating system and version:
- If Windows, are you using WSL or WSL2?:
Running into this issue as well, the weird thing is the same import path could work in 1 file but not in another file
Happens to me to. Typescript has no issue, interface being exported but NOT using swc. Also happens with export type instead of interface though.
Hello, is there any update on this issue? I'm running into the same error.
Same here.
Same here +1
Hello. Any update on this issue please?