Closed timfish closed 6 months ago
I'm going to close this temporarily for bug tracking purposes since the minimal reproduction should prove that the bug is in tsx
rather than import-in-the-middle
.
But don't let that deter you and feel free to investigate further. If you determine it's actually a bug in tsx, I'd be happy to accept a PR.
The published tsx code is minified, but the contribution guide has development tips on how you can turn it off and use the dev version: https://github.com/privatenumber/tsx/blob/master/CONTRIBUTING.md#development
Do you have any tips for debugging loader hooks? I'm console.log
ing in multiple modules but it's super painful to not be able to add breakpoints in the node built in code!
I'm highly confident that this is an issue with import-in-the-middle
and not tsx
: https://github.com/getsentry/sentry-javascript/issues/12011#issuecomment-2110923550
Turns out it's a Node bug triggered by a combination of import-in-the-middle
setting parentURL
to node:*
and tsx
attempting to load missing files while searching through various extensions.
Acknowledgements
Problem & expected behavior (under 200 words)
With
import-in-the-middle@1.7.1
and the following codetest.ts
Running:
I get the following stack trace:
If you disable
allowJs
this no longer errors.Bugs are expected to be fixed by those affected by it
Supporting engineering work financially will speed up resolution