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

fix: warn about ts-node and node 20 #818

Merged
merged 4 commits into from
Oct 11, 2023
Merged

Conversation

mdonnalley
Copy link
Contributor

@mdonnalley mdonnalley commented Oct 10, 2023

  • Warn when ts-node is being used to execute bin/dev.js and node is >= 20
  • Fall back to compiled source when ts-node cannot be used

Fixes #817

@W-14270164@

@@ -1,5 +1,6 @@
/* eslint-disable complexity */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is required - it passed linting for me locally

src/execute.ts Outdated
@@ -34,7 +34,7 @@ import {settings} from './settings'
*
* @example For CJS dev.js
* ```
* #!/usr/bin/env ts-node
* #!/usr/bin/env -S node --loader ts-node/esm --no-warnings=ExperimentalWarning
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll defer to you, but all of this ESM stuff is new to me... but I would've expected the CJS to remain the same?

WillieRuemmele
WillieRuemmele previously approved these changes Oct 11, 2023
@mdonnalley mdonnalley merged commit 00ed4fe into main Oct 11, 2023
35 checks passed
@mdonnalley mdonnalley deleted the mdonnalley/ts-node-node20 branch October 11, 2023 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

./bin/dev.js throws ERR_UNKNOWN_FILE_EXTENSION on Node 20
2 participants