-
Notifications
You must be signed in to change notification settings - Fork 73
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
./bin/dev.js throws ERR_UNKNOWN_FILE_EXTENSION
on Node 20
#817
Comments
Git2Gus App is installed but the |
@bader-nasser Both issues are due to using |
@mdonnalley I added these scripts and used them with @oclif/core v3 & v2 "dev": "ts-node ./bin/dev.js",
"dev2": "./bin/dev.js", but still nothing is working! |
@bader-nasser my bad - I forgot that support for auto-transpiling local plugins hasn't been merged yet. It's being added in this PR: #779 In the meantime, you'll need to compile your changes first before executing the plugin. Also important to note that auto-transpiling ESM plugins will only be supported when developing the plugin from the plugin directory. In other words, |
For the time being I switched back to v2 and I may wait a lil' bit before using v3 again! Thank you. |
@mdonnalley I upgraded to latest deps and found the dev bin. is working with: #!/usr/bin/env -S node --loader ts-node/esm --no-warnings=ExperimentalWarning not: #!/usr/bin/env ts-node and I don't know why! I run it using npm script: https://github.com/bader-nasser/pdftools/blob/main/bin/dev.js |
@bader-nasser can you elaborate on what you're seeing? I just checked out your repo, ran |
@mdonnalley It works with node 18 and causes an error with node 20! I used shamefully-hoist = true
public-hoist-pattern[]=* as well as using $ npm run app-dev -- e -h # and pnpm app-dev e -h
(node:31017) [ERR_UNKNOWN_FILE_EXTENSION] TypeError Plugin: @bader-nasser/pdftools: Unknown file extension ".ts" for .../src/commands/compress/index.ts
module: @oclif/[email protected]
task: cacheCommand
plugin: @bader-nasser/pdftools
root: .../pdftools
See more details with DEBUG=*
(Use `node --trace-warnings ...` to show where the warning was created)
(node:31017) [ERR_UNKNOWN_FILE_EXTENSION] TypeError Plugin: @bader-nasser/pdftools: Unknown file extension ".ts" for .../src/commands/convert/index.ts
module: @oclif/[email protected]
task: cacheCommand
plugin: @bader-nasser/pdftools
root: .../pdftools
See more details with DEBUG=*
(node:31017) [ERR_UNKNOWN_FILE_EXTENSION] TypeError Plugin: @bader-nasser/pdftools: Unknown file extension ".ts" for .../src/commands/extract/index.ts
module: @oclif/[email protected]
task: cacheCommand
plugin: @bader-nasser/pdftools
root: .../pdftools
See more details with DEBUG=*
(node:31017) [ERR_UNKNOWN_FILE_EXTENSION] TypeError Plugin: @bader-nasser/pdftools: Unknown file extension ".ts" for .../src/commands/merge/index.ts
module: @oclif/[email protected]
task: cacheCommand
plugin: @bader-nasser/pdftools
root: .../pdftools
See more details with DEBUG=*
(node:31017) [ERR_UNKNOWN_FILE_EXTENSION] TypeError Plugin: @bader-nasser/pdftools: Unknown file extension ".ts" for .../src/commands/process/index.ts
module: @oclif/[email protected]
task: cacheCommand
plugin: @bader-nasser/pdftools
root: .../pdftools
See more details with DEBUG=*
(node:31017) [ERR_UNKNOWN_FILE_EXTENSION] TypeError Plugin: @bader-nasser/pdftools: Unknown file extension ".ts" for .../src/commands/repair/index.ts
module: @oclif/[email protected]
task: cacheCommand
plugin: @bader-nasser/pdftools
root: .../pdftools
See more details with DEBUG=*
(node:31017) [ERR_UNKNOWN_FILE_EXTENSION] TypeError Plugin: @bader-nasser/pdftools: Unknown file extension ".ts" for .../src/commands/uncompress/index.ts
module: @oclif/[email protected]
task: cacheCommand
plugin: @bader-nasser/pdftools
root: .../pdftools
See more details with DEBUG=*
(node:31017) [ERR_UNKNOWN_FILE_EXTENSION] TypeError Plugin: @bader-nasser/pdftools: Unknown file extension ".ts" for .../src/commands/update-metadata/index.ts
module: @oclif/[email protected]
task: cacheCommand
plugin: @bader-nasser/pdftools
root: .../pdftools
See more details with DEBUG=*
Error: Command e not found.
at error (.../node_modules/@oclif/core/lib/errors/index.js:26:15)
at HelpClass.showHelp (.../node_modules/@oclif/core/lib/help/index.js:221:28)
at run (.../node_modules/@oclif/core/lib/main.js:68:20)
at async file:///.../bin/dev.js:4:1 |
This issue has been linked to a new work item: W-14270164 |
@bader-nasser I transferred this issue to It seems that node 20 introduced a breaking change to the ESM loader hooks, which affects
ts-node issue: TypeStrong/ts-node#1997 Obviously, there's not much we can do on the oclif side to fix this. The best we'll be able to do is provide a better error message and provide a couple workarounds: Workarounds
|
ERR_UNKNOWN_FILE_EXTENSION
on Node 20
great. I'm glad that the root issue is identified. |
After cloning the project and installing the deps using
pnpm
, runningnode ./bin/dev.js help
does not show the commands!Also, when I change any thing in the commands (e.g. description) and run
node ./bin/dev.js help hello
, I don't get the new values.The text was updated successfully, but these errors were encountered: