sentry-javascript icon indicating copy to clipboard operation
sentry-javascript copied to clipboard

tsx does not work with `@sentry/node/import`

Open lilouartz opened this issue 9 months ago • 0 comments

Is there an existing issue for this?

  • [X] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
  • [X] I have reviewed the documentation https://docs.sentry.io/
  • [X] 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

v8

Framework Version

No response

Link to Sentry event

No response

SDK Setup

N/A

Steps to Reproduce

How do I combine this with tsx?

tsx --import=@sentry/node/register app/bin/server.ts

is giving error:

Package subpath './register' is not defined by "exports"

node --import=@sentry/node/import --import tsx app/bin/server.ts

gives

node:internal/modules/run_main:125
    triggerUncaughtException(
    ^
SyntaxError [Error]: Unexpected token (12:14)

node --import tsx --import=@sentry/node/import app/bin/server.ts

gives

node:internal/modules/run_main:125
    triggerUncaughtException(
    ^
TypeError [ERR_INVALID_URL_SCHEME]: The URL must be of scheme file

Maybe @privatenumber knows

Expected Result

Load app with Sentry instrumentation.

Actual Result

Shown errors.

lilouartz avatar May 17 '24 14:05 lilouartz