-
Notifications
You must be signed in to change notification settings - Fork 27.3k
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
performance.measure() is crashing my route #20743
Comments
Can reproduce error with below example ? I tried to reproduce your error, but error did not occur. |
Looks like a separate bug? But I think I had performance reporting crash an API route in production as well - here's the Sentry stack trace Nextjs version Browser Edit: Looks like it didn't actually crash the route, there's another report of this, I'll move my inquiry to here #23856 |
I have a non-minimal repro case for this error, though under completely different circumstances, here: Windows 10 Requires |
I'm seeing this as well on production. It's not very frequent, but a few users are seeing this on a random basis. |
I'm also seeing this in production but not too often. It seems to be happening if a browser tab with the app is left open but inactive, and users come back to it after a while.
Next version |
In my case, looks like using useCallback + useEffect hook inside a Context is what was causing that error, when I rewrote the code the error sttoped. Very strange. |
I'm my case, i was getting the error when i use router.push() to the page i was currently on |
Same as @CRIMSON-CORP I think it could be nice to create a dedicated error message for this case |
I got the error also because I was using |
I'm also getting this error, but not when using router.push, using |
In my case router.replace() to the page that i was already on was causing that error |
@balazsorban44 |
I`m getting this error when using MSAL.js in a mobile browser. The error happens at some point when it is redirected to the Microsoft login page, and then returns as a callback to my Next.js page. |
This was exactly what I was doing in my case. Pushing to the same router I was currently on created this issue for me. Thanks for this comment @CRIMSON-CORP |
Personally I think, this issue can be closed.
There will be a error tip for this usage mistake, after this MR: #40903 It is a usage mistake, not a bug of next.js.
So I think, this issue can be closed. |
Still getting it in [email protected] would be nice to get this fixed. |
in my case, this error is triggered when using router.push twice in different components, in one component I collected all query parameters and added a new parameter with them, in the other I also collected all query parameters and added a new parameter with them solved the problem with {shallow:true} at router.push, see https://nextjs.org/docs/routing/shallow-routing |
We are also encountering this issue occasionally when a page has been open for a while and focus has been on a different browser tab. When the user returns it goes into a sort of loop with the error message This is happening after the static export of the app, not using any calls to
It seems like the app is trying to reroute the page to the same route - this warning pops up in the dev console in Chrome
Not sure if that adds anything useful for someone? |
In my case this triggered intermittently when I refreshed the page, I think NextJS should detect this case and report a proper error. |
This is exactly what my issue was, thanks! |
Had the same with replace, when the page stayed the same as well. |
Same error, nextjs version 13.1.6 with next-auth 4.20.1. export default function App({
Component,
pageProps: { session, ...pageProps },
}: AppProps) {
return (
<SessionProvider session={session}>
<ConfigProvider locale={zhCN}>
<Auth>
<Component {...pageProps} />
</Auth>
</ConfigProvider>
</SessionProvider>
);
} this is ok export default function App({
Component,
pageProps: { session, ...pageProps },
}: AppProps) {
return (
<SessionProvider session={session}>
<ConfigProvider locale={zhCN}>
{Component.auth == true ? (
<Auth>
<Component {...pageProps} />
</Auth>
) : (
<Component {...pageProps} />)}
</ConfigProvider>
</SessionProvider>
);
} |
I faced the You can see the steps to reproduce it here: #47560 (comment) |
I think i have the same issue .. @desnor what version of nextjs you have ? |
I'm experiencing this with |
It seems to go away if you add |
i dont even have router push and this crashing my next app too |
Happened to me for having two |
Can replicate with router.replace |
Same issue I think: #47560 (comment) Still happening in "next": "13.4.10", on production/development. |
More details on this bug. I get it whenever the pathname stays the same but the queries change. For instance, when the current
and I cange it to
So essentially the asPath stays the same, but the queries change. |
There're various of cases would cause the `beforeRender` performance mark is not existed in the performance entries, learned from the issues description. We have to check if that mark is existed. This PR also refactors all the mark names and measurement names into constants so that we won't easily mistype them Fixes #20743 Fixes #40903 Fixes #47560 Co-authored-by: Balázs Orbán <[email protected]>
We land a fix in the latest canary ( |
The fix is now landed in stable version 13.5.1 |
This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
What version of Next.js are you using?
10.0.4
What version of Node.js are you using?
v14.4.0
What browser are you using?
Chrome
What operating system are you using?
macOS
How are you deploying your application?
Vercel
Describe the Bug
I'm building a google oauth flow. I get the oauth menu account list opened, and click on my google account. It redirects back - unsuccessfully, to my app page. I get these errors
DOMException: Failed to execute 'measure' on 'Performance': The mark 'beforeRender' does not exist.
Uncaught (in promise) Error: Cancel rendering route
Expected Behavior
I'm building a google oauth flow. I get the oauth menu account list opened, and click on my google account. It redirects back - successfully, to my app page.
To Reproduce
I believe the error comes from this line. I suspect because my page is redirecting from google back to my app, the mark is not there or was cleared out.
next.js/packages/next/client/index.tsx
Line 534 in dbe1e62
The text was updated successfully, but these errors were encountered: