Closed AbhiPrasad closed 1 week ago
This appears to be because the tsx
and import-in-the-middle
loaders are registered in the wrong order. import-in-the-middle
is being passed TypeScript which it was never designed to parse.
This should hopefully have been fixed by the numerous PRs recently merged at import-in-the-middle
.
Specifically for tsx
, import-in-the-middle
now gracefully handles source code it can't parse by falling back to the parent loader. This does mean that iitm won't be able to hook TypeScript files but that's likely not much of a concern for now.
While we wait for this to be released, there is a patch available that combines all the fixes. If anyone can confirm this patch fixes this issue that would be super helpful!
With the newest release of import-in-the-middle
v1.9.0
this should be fixed.
If you upgrade to a fresh install of the latest version of the Node SDK it should use import-in-the-middle@1.9.0
by default.
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/node
SDK Version
8.7.0
Framework Version
Node v20.14.0
Link to Sentry event
No response
SDK Setup
Steps to Reproduce
"NODE_OPTIONS='--import ./instrument.mjs' doppler run -- tsx src/index.ts"
Discord thread: https://discord.com/channels/621778831602221064/1247628587176034324/1247628587176034324
Expected Result
Does not cause an error
Actual Result
Happens even when we pin
import-in-the-middle
to1.8.0