-
Notifications
You must be signed in to change notification settings - Fork 382
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
build: switch to node 20, add back loader param #5990
Conversation
@xiashtra why the confused emoji? |
An alternative to this PR is to switch to using
|
Nothing you are responsible for. I don't follow Node's development, so I'm just confused why the upstream change. It seems like a lot of tedious boilerplate just to run the utility scripts, and on top of that, if it's considered deprecated, what is the intended long-term solution? |
My understanding here is that node20 (or really node 18.19.x) introduced a breaking change for loaders: https://nodejs.org/en/blog/announcements/v20-release-announce#custom-esm-loader-hooks-nearing-stable This broke ts-node, see issue 1997 in https://github.com/TypeStrong/ts-node/issues (not linking directly to avoid more noise on that issue). So, I think Edit: other people suggest switching to |
09568fd
to
e1469f2
Compare
The import { register } from 'node:module';
import url from 'node:url';
const __filename = url.fileURLToPath(import.meta.url);
register('ts-node/esm', url.pathToFileURL(__filename)); and then instead of saying However, this doesn't work on node 18, and so we should only switch to it in the future once people stop using node 18. See: a0679c9 |
Instead of: `ts-node util/sync_files.ts` Now we must do: `node --loader=ts-node/esm util/sync_files.ts` This should work on both node 18 and node 20 (tested locally). Git workflows were pinned to 18.18.2 via #5991, but are now updated to 20 for constency. It's possible that ts-node will fix this in the future and we can remove (again) the loader param. Fixes #5910. Fixes #5989. 4c5cf21
Instead of: `ts-node util/sync_files.ts` Now we must do: `node --loader=ts-node/esm util/sync_files.ts` This should work on both node 18 and node 20 (tested locally). Git workflows were pinned to 18.18.2 via #5991, but are now updated to 20 for constency. It's possible that ts-node will fix this in the future and we can remove (again) the loader param. Fixes #5910. Fixes #5989. 4c5cf21
…quous#5990) Instead of: `ts-node util/sync_files.ts` Now we must do: `node --loader=ts-node/esm util/sync_files.ts` This should work on both node 18 and node 20 (tested locally). Git workflows were pinned to 18.18.2 via quisquous#5991, but are now updated to 20 for constency. It's possible that ts-node will fix this in the future and we can remove (again) the loader param. Fixes quisquous#5910. Fixes quisquous#5989. 4c5cf21
…quous#5990) Instead of: `ts-node util/sync_files.ts` Now we must do: `node --loader=ts-node/esm util/sync_files.ts` This should work on both node 18 and node 20 (tested locally). Git workflows were pinned to 18.18.2 via quisquous#5991, but are now updated to 20 for constency. It's possible that ts-node will fix this in the future and we can remove (again) the loader param. Fixes quisquous#5910. Fixes quisquous#5989. 4c5cf21
…quous#5990) Instead of: `ts-node util/sync_files.ts` Now we must do: `node --loader=ts-node/esm util/sync_files.ts` This should work on both node 18 and node 20 (tested locally). Git workflows were pinned to 18.18.2 via quisquous#5991, but are now updated to 20 for constency. It's possible that ts-node will fix this in the future and we can remove (again) the loader param. Fixes quisquous#5910. Fixes quisquous#5989. 4c5cf21
Instead of:
ts-node util/sync_files.ts
Now we must do:
node --loader=ts-node/esm util/sync_files.ts
This should work on both node 18 and node 20 (tested locally).
Git workflows were pinned to 18.18.2 via #5991, but are now updated to 20 for constency. It's possible that ts-node will fix this in the future and we can remove (again) the loader param.
Fixes #5910.
Fixes #5989.