Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERR_UNKNOWN_FILE_EXTENSION on Node v20.0.0 #53922

Closed
septs opened this issue Apr 20, 2023 · 2 comments
Closed

ERR_UNKNOWN_FILE_EXTENSION on Node v20.0.0 #53922

septs opened this issue Apr 20, 2023 · 2 comments
Labels
External Relates to another program, environment, or user action which we cannot control.

Comments

@septs
Copy link
Contributor

septs commented Apr 20, 2023

Bug Report

πŸ”Ž Search Terms

No

πŸ•— Version & Regression Information

  • node v20.0.0 failed, node v19.9.0 OK
  • typescript v5.0
  • ts-node v10.9.1

⏯ Playground Link

see Actual behavior section

πŸ’» Code

see Actual behavior section

πŸ™ Actual behavior

$ cat example.ts
console.log('example')
$ cat tsconfig.json
{ "ts-node": { "esm": true } }
$ npx ts-node example.ts
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /Users/septs/Projects/example/example.ts
    at new NodeError (node:internal/errors:399:5)
    at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:99:9)
    at defaultGetFormat (node:internal/modules/esm/get_format:139:38)
    at defaultLoad (node:internal/modules/esm/load:83:20)
    at nextLoad (node:internal/modules/esm/hooks:781:28)
    at load (/Users/septs/.npm/_npx/1bf7c3c15bf47d04/node_modules/ts-node/dist/child/child-loader.js:19:122)
    at nextLoad (node:internal/modules/esm/hooks:781:28)
    at Hooks.load (node:internal/modules/esm/hooks:381:26)
    at handleMessage (node:internal/modules/esm/worker:153:24)
    at checkForMessages (node:internal/modules/esm/worker:102:28) {
  code: 'ERR_UNKNOWN_FILE_EXTENSION'
}

πŸ™‚ Expected behavior

resolve the error

@septs
Copy link
Contributor Author

septs commented Apr 20, 2023

https://nodejs.org/en/blog/announcements/v20-release-announce

@jakebailey
Copy link
Member

This is a problem with ts-node, not TypeScript. Please file an issue on https://github.com/TypeStrong/ts-node.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
External Relates to another program, environment, or user action which we cannot control.
Projects
None yet
Development

No branches or pull requests

2 participants