You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Deno does not support module.register as seen here
The current error message when module.register is missing is a little misleading. It mentions you're using the wrong node version (see here), but actually you're not running nodejs at all
It should probably say something like
Version ${process.version} of your runtime does not support module.register(). If you are using Node.js, upgrade to Node v18.19 or v20.6 and above.
If you're wondering how process.version even works at all on Deno, it's because Deno pretends it is running Node 22.10.0 just to make sure it doesn't crash on any library that depends on process.version
Bugs are expected to be fixed by those affected by it
I'm interested in working on this issue
Compensating engineering work will speed up resolution and support the project
I'm willing to offer $10 for financial support
The text was updated successfully, but these errors were encountered:
Given this, I don't think it makes sense to include code that handles non-Node environments. This is especially unnecessary considering other environments like Deno and Bun already have built-in support for types.
Managing compatibility with alternative runtimes should be the responsibility of the libraries using tsx, not tsx itself.
Generally speaking I agree which is why I only changed the error message instead of doing any kind of env variable checking to figure out which environment it is
A lot of projects use tsx as you know so it's inevitable that somebody will run tsx in a different runtime even if unintentionally through a dependency (that was my case)
It's totally fine not to merge this - just the fact that when you search Deno in this repo this issue comes up is probably enough to unblock anybody else that runs into this issue without having to actually commit anything to the repo
Acknowledgements
Minimal reproduction URL
denoland/deno#23201
Problem & expected behavior (under 200 words)
Deno does not support
module.register
as seen hereThe current error message when
module.register
is missing is a little misleading. It mentions you're using the wrong node version (see here), but actually you're not running nodejs at allIt should probably say something like
If you're wondering how
process.version
even works at all on Deno, it's because Deno pretends it is running Node 22.10.0 just to make sure it doesn't crash on any library that depends onprocess.version
Bugs are expected to be fixed by those affected by it
Compensating engineering work will speed up resolution and support the project
The text was updated successfully, but these errors were encountered: