Skip to content

TypeError: Class extends value undefined is not a constructor or null (HttpInstrumentation) #16575

Closed as not planned

Description

@Shudrum

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

^9.3.0

Framework Version

No response

Link to Sentry event

No response

Reproduction Example/SDK Setup

package.json

{
  "name": "sentry-issue",
  "type": "module",
  "scripts": {
    "start": "tsx index.ts"
  },
  "dependencies": {
    "@sentry/node": "9.3.0",
    "tsx": "^4.20.2"
  }
}

index.ts

import * as Sentry from '@sentry/node';

console.log(Sentry);

Steps to Reproduce

The issue can be reproduced from the 9.3 version. It works properly on the 9.2 one.

  1. Just use the provided package.json
  2. npm i
  3. npm start
  4. Boom

I really tried to find this issue without success. Really sorry if it is a duplicate.
This one seems so obvious I really think you already have it.

Expected Result

Just the log of the Sentry instance.

Actual Result

export class HttpInstrumentation extends InstrumentationBase<HttpInstrumentationConfig> {
  ^

TypeError: Class extends value undefined is not a constructor or null
at Object.<anonymous> (/Users/shudrum/sentry-issue/node_modules/@opentelemetry/instrumentation-http/src/http.ts:97:42)
at loadCJSModule (node:internal/modules/esm/translators:161:3)
at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:196:7)
at ModuleJob.runSync (node:internal/modules/esm/module_job:258:17)
at require (node:internal/modules/esm/translators:146:9)
at Object.<anonymous> (/Users/shudrum/sentry-issue/node_modules/@opentelemetry/instrumentation-http/src/index.ts:17:1)
at loadCJSModule (node:internal/modules/esm/translators:161:3)
at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:196:7)
at ModuleJob.run (node:internal/modules/esm/module_job:271:25)
at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:547:26)

Activity

  1. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Jun 13, 2025
  2. Shudrum commented on Jun 13, 2025

    @Shudrum
    Author

    OK, I closed it because I though I made a mistaka with the type: "module" of the package.json.
    But I'm pretty sure I should keep it, also, as it worked properly on 7.x / 8.x and <= 9.2, I prefer to keep the issue.

  3. SimonPrague commented on Jun 13, 2025

    @SimonPrague

    Well, this just completely broke multiple of our apps, and we can't deploy to production. I'd love to know which version to downgrade to. This is a pretty urgent problem for our company.

  4. nathankirk91 commented on Jun 13, 2025

    @nathankirk91

    Having the same issue, any help would be much appreciated.
    Thanks

  5. SimonPrague commented on Jun 13, 2025

    @SimonPrague

    Not sure of there is a way to mark something as CRITICAL. But this definitely seems like that situation!

    Error tracking software completely bricks production applications ... ups

  6. mydea commented on Jun 13, 2025

    @mydea
    Member

    Thanks for raising this. This seems to be an issue with tsx, I would assume, as we have a whole bunch of tests covering that stuff generally works. It is obviously still not good and something we want to fix, we'll look into this!

  7. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Jun 13, 2025
  8. Lms24 commented on Jun 13, 2025

    @Lms24
    Member

    @SimonPrague @nathankirk91 are you also using tsx like in the issue or another build/runtime setup?

    Can you confirm that this happens after updating the SDK to the latest version (released today 9.29.0)? My hunch is that if we get three reports within an hour after the release it's likely related to the latest version but can't say for sure yet.

  9. Shudrum commented on Jun 13, 2025

    @Shudrum
    Author

    Hello.

    I confirm that the issue is still reproductible on 9.29.0.

  10. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Jun 13, 2025
  11. Lms24 commented on Jun 13, 2025

    @Lms24
    Member

    Assuming you all use tsx (which I still don't have confirmation for), I'm 99% sure this is an issue with the latest tsx version, caused by privatenumber/tsx@c188268

    @Shudrum if I change nothing in your repro but pin the tsx version to 4.20.1 (instead of the latest 4.20.2) I no longer get this error.

  12. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Jun 13, 2025
  13. Lms24 commented on Jun 13, 2025

    @Lms24
    Member

    This was also reported in privatenumber/tsx#727 and it seems like the tsx maintainer is working on reverting the change. So I think we can consider this handled.

    Though I'll take this as an opportunity to also add a tsx e2e test application to our repo, just to have a little bit more coverage on this end.

  14. Lms24 commented on Jun 13, 2025

    @Lms24
    Member

    Can confirm that everything seems to work again with tsx@4.20.3 which was released a couple of minutes ago.

  15. Shudrum commented on Jun 13, 2025

    @Shudrum
    Author

    Hello!

    I really didn't though to test a lower TSX version :/ sorry

    But I confirm :

    • 4.20.1 ✅
    • 4.20.2 🔴
    • 4.20.3 ✅

    Super thank you @Lms24!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions