sentry-javascript icon indicating copy to clipboard operation
sentry-javascript copied to clipboard

User Feedback button diappears after using NextJS's router

Open suuf opened this issue 1 year ago • 0 comments

Is there an existing issue for this?

  • [X] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
  • [X] I have reviewed the documentation https://docs.sentry.io/
  • [X] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/nextjs

SDK Version

8.9.1

Framework Version

Nextjs 14

Link to Sentry event

No response

SDK Setup

No response

Steps to Reproduce

  1. Apply minimum setup for User Feedback (i.e. not using any custom UI nor the User Feedback API)
  2. Visit a NextJS page using User Feedback
  3. The User Feedback button is present on the page
  4. Call something like handleClick, as shown below - utilizing NextJS's router
  import { useRouter } from "next/navigation";

  const router = useRouter();

  const handleClick = () => {
    router.push("/home");
  };

Expected Result

I would expect the User Feedback button to be present at all pages visited through router.push( ) 🙃

Actual Result

The User Feedback button disappears, and is not present in the DOM. The page then needs to be refreshed manually for the User Feedback button to show up again.

suuf avatar Jun 19 '24 07:06 suuf