Skip to content

@sentry/sveltekit gives me the error: "An error occurred on the client side: TypeError: Cannot read properties of undefined (reading 'getIntegrationById')" #8290

Closed
@alexbjorlig

Description

@alexbjorlig

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/sveltekit

SDK Version

7.54.0

Framework Version

1.20.1

Link to Sentry event

No response

SDK Setup

hooks.client.ts

Sentry.init({
        dsn: config.sentryDsn,
        integrations: [new Sentry.Integrations.Breadcrumbs({ console: false })],
        tracesSampleRate: 0.01,
        release: revision
})

hooks.server.ts

Sentry.init({
        dsn: config2().sentry.dsn,
        environment: config2().sentry.environment,
        release: process.env['VERCEL_GIT_COMMIT_SHA'],
})

Steps to Reproduce

When running my applications e2e test with playwright, I get this error:

An error occurred on the client side: TypeError: Cannot read properties of undefined (reading 'getIntegrationById')
    at instrumentSvelteKitFetch (http://localhost:5100/node_modules/.vite/deps/@sentry_sveltekit.js?v=8db7b1bd:15107:44)
    at Object.apply (http://localhost:5100/node_modules/.vite/deps/@sentry_sveltekit.js?v=8db7b1bd:15086:16)
    at load_node (http://localhost:5100/@fs/Users/alexbjorlig/Documents/eddystone/node_modules/@sveltejs/kit/src/runtime/client/client.js?v=8db7b1bd:525:40)
    at async Promise.all (index 2)
    at async Object._hydrate (http://localhost:5100/@fs/Users/alexbjorlig/Documents/eddystone/node_modules/@sveltejs/kit/src/runtime/client/client.js?v=8db7b1bd:1753:20)
    at async Module.start (http://localhost:5100/@fs/Users/alexbjorlig/Documents/eddystone/node_modules/@sveltejs/kit/src/runtime/client/start.js:22:3) {url: URL, params: Object, route: Object}

Expected Result

No issues with import * as Sentry from '@sentry/sveltekit';

Actual Result

The error An error occurred on the client side: TypeError: Cannot read properties of undefined (reading 'getIntegrationById')

CleanShot 2023-06-05 at 22 03 19@2x

Metadata

Metadata

Assignees

No one assigned

    Labels

    Package: sveltekitIssues related to the Sentry SvelteKit SDK

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions