Skip to content

@sentry/node assert.default is not a function #11002

Closed

Description

@brianYuDesign

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

7.160.0

Framework Version

No response

Link to Sentry event

No response

SDK Setup

Sentry.init({
   dsn: 'https://d63cc5d3abd141a18ad741ccd49765c3@sentry.5198755.com/32',
   environment: process.env.APP_ENV,
   tracesSampleRate: 1.0,
   release: version,
   transportOptions: {
     proxy: process.env.HTTPS_PROXY,
   },
   integrations: (integrations) => {
     return integrations.map((integration) => {
       if (integration.name === 'OnUncaughtException') {
         // override `OnUncaughtException` integration to not exit.
         return new Sentry.Integrations.OnUncaughtException({
           // do not exit if other uncaught exception handlers are registered.
           exitEvenIfOtherHandlersAreRegistered: false,
         });
       } else {
         return integration;
       }
     });
   },
 });

Steps to Reproduce

I am currently utilizing a Sentry proxy in my setup. However, this week, I've encountered instability with my proxy network, leading to the issue: assert.default is not a function.

After this error , the process is terminated.

Expected Result

here is souce code: https://github.com/getsentry/sentry-javascript/blob/master/packages/node/src/proxy/index.ts

  import * as assert from 'assert';

Actual Result

截圖 2024-03-11 上午10 40 59

Activity

  1. moved this to Waiting for: Product Owner in GitHub Issues with 👀 2on Mar 11, 2024
  2. Lms24 commented on Mar 11, 2024

    @Lms24
    Member

    Hey @brianYuDesign thanks for writing in!

    @timfish when you have a minute, would you mind taking a look at this?

    I'm wondering why we have the assert statement in the vendored in proxy agent code. Do we need this?
    https://github.com/getsentry/sentry-javascript/blob/master/packages/node/src/proxy/index.ts#L193

  3. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 2on Mar 11, 2024
  4. timfish commented on Mar 11, 2024

    @timfish
    Collaborator

    I've opened PRs to remove this.

    I vendored the code while trying to make as few changes to it as possible and completely missed this!

  5. AbhiPrasad commented on Mar 14, 2024

    @AbhiPrasad
    Contributor
  6. ghost added on Aug 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions