Skip to content

NextJS 14 with Sentry 8.48.0: [RouterEvents not found] #14928

Answered by ahetawal-p
ahetawal-p asked this question in Q&A
Discussion options

You must be logged in to vote

No I am not.
Only thing after migrating to NextJS14 was this.

jest.mock('next/navigation', () => ({
  usePathname: jest.fn(),
}))
;(usePathname as jest.Mock).mockImplementation(() => '/')

However for my test to pass I had to add this to work now...

jest.mock('@sentry/nextjs', () => ({
  browserTracingIntegration: jest.fn().mockReturnValue({}),
}))

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ahetawal-p
Comment options

Answer selected by ahetawal-p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants