Skip to content

Unhandled Promise Rejection in debugger on Node startup #12343

@mwenko

Description

@mwenko

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

8.7.0

Link to Sentry event

No response

SDK Setup

Sentry.init({
            dsn: dsn,
            environment: environmentWithAppInstance,
            debug: true,
            maxValueLength: maxValueLength,
            release: version,
            integrations: [nodeProfilingIntegration()],
            skipOpenTelemetrySetup: true,
            tracesSampler: (context) => {
                if (context.request?.url?.endsWith("/status")) {
                    return 0;
                }

                return defaultTraceSampleRate;
            },
            profilesSampleRate: profilesSampleRate,
            beforeBreadcrumb(breadcrumb, _) {
                if (!shouldAddBreadcrumb(breadcrumb)) {
                    return null;
                }

                return breadcrumb;
            },

            beforeSend(event: ErrorEvent, hint: Sentry.EventHint) {
                if (!shouldSend(hint)) {
                    return null;
                }

                event = removeAuthorizationHeader(event);

                return event;
            },
        });

Steps to Reproduce

  1. Run nest start --debug --watch

Node: 20.9.0
NestJS: 10.3.8

Expected Result

The application should start without throwing an unhandled promise rejection.

Actual Result

It throws an unhandled promise rejection (see screenshot):

image

If I unmark "uncaught exception" in my editor it starts like expected.

Metadata

Metadata

Type

Projects

Status

No status

Relationships

None yet

Development

No branches or pull requests

Issue actions