Skip to content

ReactRouter v6 instrumentation does not consider initialEntries for pageload transactions when using memory router #14814

Closed
@lforst

Description

@lforst

Description

A user reported that they are using withSentryReactRouterV6Routing(Routes) with createMemoryRouter().
The user is passing in the initial routes to render via createMemoryRouter's initialEntries option.

They observed that for their application they exclusively got /index.html pageload transactions when the app loads. This is undesired behavior.

We should probably use the initialEntries option for pageload transactions instead of window.location.pathname when available.

One thing we need to be somewhat wary of is that people may use the same opts for a memory router and for a browser router and for the browser router it would probably be undesired to take the initialEntries. Maybe we need to be clever to properly distinguish.

This should land in both the v8 and develop branches.

Metadata

Metadata

Labels

Package: reactIssues related to the Sentry React SDK

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions