Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/node
SDK Version
8.0.0
Framework Version
No response
Link to Sentry event
No response
SDK Setup
Sentry.init({
dsn: 'https://[email protected]/0',
});
Steps to Reproduce
I've created a minimal reproduction here: https://github.com/nwalters512/sentry-v8-tsx-error-repro
- Clone the repository
- Install dependencies with
yarn
- Run
yarn tsx src/index.ts
- Observe that the process fails with the error
TypeError [ERR_INVALID_URL_SCHEME]: The URL must be of scheme file
Several observations that are hopefully helpful to y'all:
-
This only occurs when
"allowJs": true
is set intsconfig.json
. As Sentry isn't concerned with this, that made me think this problem might actually be intsx
. However... -
When adding instrumentation directly with the
@opentelemetry/*
packages, everything works fine. This is reproducible by making the following change tosrc/index.ts
:-import './instrument-sentry.js'; +import './instrument-opentelemetry.js';
Given this, I'm strongly inclined to believe that this is an issue with the way in which Sentry is using OpenTelemetry.
-
This only breaks for core Node modules like
util
,fs
, etc. Importing other modules works fine. For instance, the following change tosrc/index.ts
makes it work without erroring:-await import('util'); +await import('zod');
-
This only breaks for dynamic imports. For instance, the following change to
src/index.ts
makes it work without erroring:-await import('util'); +import 'util';
Expected Result
I would expect the process to complete successfully and log util imported!
.
Actual Result
The process errors out while importing util
and does not print util imported!
.
Metadata
Metadata
Assignees
Type
Projects
Status