Skip to content

SDK throws Exception if integration is undefined #7200

@lucas-zimerman

Description

@lucas-zimerman

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using? If you use the CDN bundles, please specify the exact bundle (e.g. bundle.tracing.min.js) in your SDK setup.

@sentry/angular

SDK Version

7.37.1

Framework Version

Tested with Sentry Angular and Sentry React

Link to Sentry event

There's no error captured since it happened during the SDK Initialization

SDK Setup

Sentry.init({
  dsn: 'https://[email protected]/5522756',
  replaysOnErrorSampleRate: 1.0,
  integrations: [ 
    new Replay({ stickySession: true, sessionSampleRate: 1.0, blockAllMedia: true }),,
  ],
});

Steps to Reproduce

add ,, into the integration list

Expected Result

  • Sentry may not work but doesn't affect the website loading.

Issue originally appeared by removing some integrations and I didn't notice there was an additional comma on the integration list and I was just wondering why the website wasn't loading.

Actual Result

Website doesn't load, error shows on console:

bootstrap:27 
        
       Uncaught TypeError: Cannot destructure property 'name' of 'currentInstance' as it is undefined.
    at integration.ts:30:1
    at Array.forEach (<anonymous>)
    at filterDuplicates (integration.ts:29:1)
    at getIntegrationsToSetup (integration.ts:66:1)
    at Module.init (sdk.ts:123:1)
    at ./src/index.js (index.js:10:1)
    at options.factory (react refresh:6:1)
    at __webpack_require__ (bootstrap:24:1)
    at startup:7:1
    at startup:7:1

Error seems to be throwing here: https://github.com/getsentry/sentry-javascript/blob/master/packages/core/src/integration.ts#L30

Metadata

Metadata

Assignees

No one assigned

    Labels

    Package: coreIssues related to the Sentry Core SDK

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions