This repository was archived by the owner on Feb 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Unknown file extension ".ts" #12
Copy link
Copy link
Open
Description
Trying to run node -r @swc/register test.ts throws the following:
❯ node -r @swc/register test.ts
internal/process/esm_loader.js:74
internalBinding('errors').triggerUncaughtException(
^
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for test.ts
at Loader.defaultGetFormat [as _getFormat] (internal/modules/esm/get_format.js:71:15)
at Loader.getFormat (internal/modules/esm/loader.js:104:42)
at Loader.getModuleJob (internal/modules/esm/loader.js:242:31)
at async Loader.import (internal/modules/esm/loader.js:176:17)
at async Object.loadESM (internal/process/esm_loader.js:68:5) {
code: 'ERR_UNKNOWN_FILE_EXTENSION'
}
Context
- node, npm: v14.17, v8
- package.json:
...
"type": "module",
...
"@swc/cli": "^0.1.51",
"@swc/core": "^1.2.111",
"@swc/register": "^0.1.7",
- .swcrc
{
"minify": false,
"sourceMaps": true,
"env": {
"target": "node",
"mode": "entry",
"coreJs": 3
},
"module": {
"type": "es6"
},
"jsc": {
"parser": {
"syntax": "typescript",
"tsx": false,
"decorators": false,
"dynamicImport": false
}
}
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels