Skip to content

@sentry/gatsby: TypeError: Cannot read properties of undefined (reading 'href') after upgrading to latest version #10578

Closed

Description

@elanderos318

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/gatsby

SDK Version

7.100.1

Framework Version

5.12.11

Link to Sentry event

No response

SDK Setup

Sentry.init({
  dsn: {my_dsn},
  enabled: process.env.NODE_ENV === 'development',
  environment: process.env.NODE_ENV,
  tracesSampleRate: 1.0
})

Steps to Reproduce

  1. upgrade to latest @sentry/gatsby version to reduce bundle size
  2. start a staging build in gatsby cloud
  3. error logged

Expected Result

works as it did in 7.42.0

Actual Result

TypeError: Cannot read properties of undefined (reading 'href')
- browserTracingIntegration.js:185 Object.afterAllSetup
    [...]/[@sentry-internal]/tracing/esm/browser/browserTracingInte    gration.js:185:31
- integration.js:98 afterSetupIntegrations
    [...]/[@sentry]/core/esm/integration.js:98:1
- baseclient.js:423 BrowserClient._setupIntegrations
    [...]/[@sentry]/core/esm/baseclient.js:423:5
 - baseclient.js:270 BrowserClient.init
    [...]/[@sentry]/core/esm/baseclient.js:270:1
- sdk.js:56 initializeClient
    [...]/[@sentry]/core/esm/sdk.js:56:1

image

Activity

  1. moved this to Waiting for: Product Owner in GitHub Issues with 👀 2on Feb 8, 2024
  2. elanderos318 commented on Feb 8, 2024

    @elanderos318
    Author

    update, error no longer thrown after downgrading to 7.99.0

  3. Lms24 commented on Feb 9, 2024

    @Lms24
    Member

    Hi @elanderos318 any chance that the browserTracingIntegration is registered on the server side? Haven't looked much into Gatsby yet but this smells like browser code being executed on the server.

  4. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 2on Feb 9, 2024
  5. mydea commented on Feb 14, 2024

    @mydea
    Member

    I think we can add some extra guards here, but generally it should be avoided to call this in a non-browser environment!

  6. Skeyelab commented on Feb 20, 2024

    @Skeyelab

    I am still having this issue. Even with 7.102

  7. mydea commented on Feb 21, 2024

    @mydea
    Member

    Hey, I forgot to backport this to v7, will include it in the next release!

  8. Skeyelab commented on Feb 21, 2024

    @Skeyelab

    @mydea thanks. Any idea when the next release will go out?

  9. mydea commented on Feb 21, 2024

    @mydea
    Member

    We'll probably cut another release this week, we'll keep you posted in this issue!

  10. 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

No one assigned

    Labels

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions