-
Notifications
You must be signed in to change notification settings - Fork 27.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pages bugfix: prevent cancellation errors from being logged (#69766)
When another data request is received by the pages router, a cancellation error is thrown and is meant to be caught by `change` to signal that the navigation request was aborted. However we were logging the error right before we handled the logic to properly bubble the error up. This meant that it was logging an exception to the console that wasn't actionable. Fixes #40554 Closes NEXT-3731
- Loading branch information
Showing
5 changed files
with
39 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import Router from 'next/router' | ||
|
||
const RedirectPage = () => { | ||
return <h1>Redirect Page</h1> | ||
} | ||
|
||
RedirectPage.getInitialProps = (context) => { | ||
const { req, res } = context | ||
if (req) { | ||
res.writeHead(302, { Location: '/normal' }) | ||
res.end() | ||
} else { | ||
Router.push('/normal') | ||
} | ||
return {} | ||
} | ||
|
||
export default RedirectPage |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters