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

Warning when running tsx on node 20.8.0 #330

Closed
2 tasks
doberkofler opened this issue Oct 2, 2023 · 4 comments · Fixed by #337
Closed
2 tasks

Warning when running tsx on node 20.8.0 #330

doberkofler opened this issue Oct 2, 2023 · 4 comments · Fixed by #337
Labels
bug Something isn't working outdated pr welcome

Comments

@doberkofler
Copy link

Problem

tsx --trace-warnings scripts/build.ts

(node:9241) ExperimentalWarning: --experimental-loader may be removed in the future; instead use register():
--import 'data:text/javascript,import { register } from "node:module"; import { pathToFileURL } from "node:url"; register("file%3A///Users/doberkofler/MyDev/ljs_app/trunk/desktop/ttr/web/node_modules/tsx/dist/loader.mjs", pathToFileURL("./"));'
at createModuleLoader (node:internal/modules/esm/loader:534:17)
at get esmLoader [as esmLoader] (node:internal/process/esm_loader:18:26)
at node:internal/modules/cjs/loader:118:47
at node:internal/util:796:15
at Module.load (node:internal/modules/cjs/loader:1094:26)
at Module._load (node:internal/modules/cjs/loader:938:12)
at Module.require (node:internal/modules/cjs/loader:1115:19)
at require (node:internal/modules/helpers:130:18)
at Object. (/Users/doberkofler/MyDev/ljs_app/trunk/desktop/ttr/web/node_modules/tsx/dist/preflight.cjs:1:20)
at Module._compile (node:internal/modules/cjs/loader:1241:14)

Expected behavior

No warning

Minimal reproduction URL

https://stackblitz.com/edit/node-huzszn?file=index.ts

Version

3.13.0

Node.js version

20.8.0

Package manager

npm

Operating system

macOS

Contributions

  • I plan to open a pull request for this issue
  • I plan to make a financial contribution to this project
@doberkofler doberkofler added bug Something isn't working pending triage labels Oct 2, 2023
@privatenumber
Copy link
Owner

@hermesalvesbr

This comment was marked as spam.

@rmobis

This comment was marked as spam.

@privatenumber
Copy link
Owner

I briefly investigated this, and it looks like the warning is coming from the loader thread, so there's no good way to suppress it.

I think the best way forward is to actually update the API to use --import and register.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working outdated pr welcome
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants