Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
lforst opened this issue Dec 20, 2024 · 2 comments
Assignees
Labels
Feature: Spans Package: react Issues related to the Sentry React SDK

Comments

@lforst
Copy link
Member

lforst commented Dec 20, 2024

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.

@lforst
Copy link
Member Author

lforst commented Dec 20, 2024

@onurtemizkan is this something you would want to work on with medium-high-ish priority?

@lforst lforst self-assigned this Dec 20, 2024
@onurtemizkan
Copy link
Collaborator

@lforst - Yes sure 👍

@onurtemizkan onurtemizkan self-assigned this Dec 20, 2024
@AbhiPrasad AbhiPrasad added Package: react Issues related to the Sentry React SDK Feature: Spans labels Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature: Spans Package: react Issues related to the Sentry React SDK
Projects
None yet
Development

No branches or pull requests

3 participants