Closed SystemParadox closed 3 weeks ago
Your minimal repro doesn't use tsx.
Oops sorry, looks like that got removed while I was testing. I have put the import 'tsx'
back in but the result is exactly the same.
Ok thanks. I did wonder if this might be the answer but I'm not entirely clear on the reason for it. My understanding was that all of import 'tsx'
should execute first (which would include the register
call) before we try to import './foo.ts'
.
Possibly something to do with parallelisation? Or is it just that node doesn't want to complicate things by allowing hooks to be added within the loading of a file?
Acknowledgements
Minimal reproduction URL
https://stackblitz.com/edit/node-57nwqh?file=index.mjs
Problem & expected behavior (under 200 words)
node index.mjs
withimport 'tsx'
results inTypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts"
node --import tsx index.mjs
worksBugs are expected to be fixed by those affected by it
Compensating engineering work financially will speed up resolution