Skip to content

Next.js SDK changes navigation behavior #16356

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

Open
3 tasks done
landenai opened this issue May 21, 2025 · 0 comments
Open
3 tasks done

Next.js SDK changes navigation behavior #16356

landenai opened this issue May 21, 2025 · 0 comments

Comments

@landenai
Copy link

landenai commented May 21, 2025

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/nextjs

SDK Version

8

Framework Version

No response

Link to Sentry event

No response

Reproduction Example/SDK Setup

  • Application is using Sentry/next.js v8 and Sentry/profiling-node v9.1.0 but is getting the same issue with Sentry/next.js v9.12.0 and Sentry/profiling-node v9.12.0
  • Application uses Next.js's Pages router

Steps to Reproduce

(When routing on desktop)

  1. The header content is dynamically loaded from a CMS as JSON. This JSON is used to render a Header component from the design system. The header displays top-level links.
  2. When a user hovers over a link, a debounced JavaScript handler updates a React state flag to true.
    This causes a re-render and opens the sub-navigation menu.
  3. On clicking a sub-navigation link:
  • The browser updates the URL.
  • The relevant page content loads.
  • The sub-navigation menu closes automatically.
  • State is never explicitly reset

(When routing on mobile)

  • MUI's Menu component is used
  1. Clicking a header link: Updates a React state with the currentTarget from the click event. This opens the sub-navigation menu.
  2. After clicking a sub-navigation link:
  • The path updates.
  • The correct content loads.
  • State is never explicitly reset

Expected Result

For each case, the sub-navigation closes automatically on the new page

Actual Result

For each case, the sub-navigation stays open on the new page

@landenai landenai added the Bug label May 21, 2025
@landenai landenai changed the title Next.js SDK changes routing behaivor Next.js SDK changes navigation behavior May 21, 2025
@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 May 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Waiting for: Product Owner
Development

No branches or pull requests

2 participants