Open p-iknow opened 1 year ago
@ijjk
I saw that you recently posted a PR about the router, and I didn't know who to tag, so I tagged you based on that PR. Could you please take a look at this issue?
Hey @p-iknow , did you find a way to reproduce it or a way to fix it? I'm also seeing the errors in sentry, 100% iPhone, Mac and iPad.
But, I don't have any idea how to reproduce it. I tried it on real device, opening the nextjs webpage via email (and thus implying the webview to open), but I did not get the error.
How do you know it's webview?
But I get this error in two ways (in page router - "next": "^13.4.19")
in IOS routes are nested dynamic Routes. like: /pages/lessons/[lessonId]/[storyId]/[itemId]
but in android web view routes are static! (Some parts of our web app are displayed in the our Android application with web view and these errors are created in this way)
@p-iknow Please see this issue https://github.com/vercel/next.js/issues/61152 if it's of any help. I can consistently replicate the error in OSX Safari 16. In iOS Safari 16 the issue can be replicated on the same way, but it's a bit trickier to show the console, that's why I supplied only the steps for OSX in the issue.
If you want to ignore the error for Sentry until it's fixed, you can try with this code. See the comments for replication on iOS.
Sentry.init({
beforeSend(event, hint) {
const isNextRouteCancellationError = hint?.originalException?.message === 'Cancel rendering route';
if (isNextRouteCancellationError) {
// uncomment line below if you want to verify the bug in iOS without the console
// alert('route cancel error');
return null;
}
return event;
}
}};
Verify canary release
Provide environment information
Which area(s) of Next.js are affected? (leave empty if unsure)
No response
Link to the code that reproduces this issue
no-link
To Reproduce
It's only reproducing in production, and when I try to reproduce it, I can't figure out how to do it.
This webpage is run on ios webview. This error does not occur in Android WebView.
Before this error occurs, navigation to the same route occurs multiple times. It is sentry capture
In code we don't use NextLink tag, In our code, we don't use the next link tag, we get router from useRouter and use it in the form of router.push.
I tried applying e.preventDefault() based on this issue, but it didn't have any effect.
Describe the Bug
Cancel rendering route
Expected Behavior
Don't occur this error.
Which browser are you using? (if relevant)
mobile safari 16.0 webview
How are you deploying your application? (if relevant)
No response
package I use