Skip to content

BrowserTracing error with angular universal #4157

@mebibou

Description

@mebibou

Package + Version

  • @sentry/angular: 6.14.1
  • @sentry/tracing: 6.14.1

Description

In my angular application, I do this to initialize sentry:

Sentry.init({
  ...environment.sentryApi,
  integrations: [
    new Sentry.Integrations.TryCatch({
      XMLHttpRequest: false
    }),
    new Integrations.BrowserTracing({
      routingInstrumentation: Sentry.routingInstrumentation
    })
  ],
  tracesSampleRate: 0.5
});

This works fine when running the webapp, but recently I tried doing prerendering and I got the following error:

✖ Prerendering routes to /[...]/www/browser failed.
Cannot read property 'pathname' of undefined

When I remove this part:

new Integrations.BrowserTracing({
      routingInstrumentation: Sentry.routingInstrumentation
    })

Then everything works fine.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions