Skip to content
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

9.5.0 expects pageProps in error pages unconditionally #15647

Closed
kirill-konshin opened this issue Jul 29, 2020 · 1 comment · Fixed by #15667
Closed

9.5.0 expects pageProps in error pages unconditionally #15647

kirill-konshin opened this issue Jul 29, 2020 · 1 comment · Fixed by #15667
Milestone

Comments

@kirill-konshin
Copy link
Contributor

Describe the bug

Next team has changed the codebase in 9.5.0. They added a check for pageProps in client code.

When _error page is opened, next _error page will throw:

TypeError: Cannot read property 'statusCode' of undefined

on this line.

This seems to be a bug in Next.js, as this check is not legitimate, since pageProps may not exist in the hydrateProps if the application was wrapped with old-style _app. It was working in 9.4.x and broke in 9.5.0.

To Reproduce

https://codesandbox.io/s/blissful-wave-lpxv9

I also created a repo: https://github.com/skoob13/next-redux-wrapper/commit/2b106126659195b79725d2d7f321ae4794d8a3c3.

Steps to reproduce:

  1. Open codesandbox
  2. Press "Navigate to error"
  3. Observe an error

Expected behavior

Error page should open.

@kodiakhq kodiakhq bot closed this as completed in #15667 Jul 30, 2020
kodiakhq bot pushed a commit that referenced this issue Jul 30, 2020
`pageProps` should always be defined to ensure everything is working as expected although to prevent a breaking change this adds an additional check before attempting to access `pageProps` before hydration. It also adds tests to prevent regressing on this

Closes: #15647
@Timer Timer added this to the iteration 6 milestone Jul 30, 2020
LauraBeatris pushed a commit to LauraBeatris/next.js that referenced this issue Sep 1, 2020
`pageProps` should always be defined to ensure everything is working as expected although to prevent a breaking change this adds an additional check before attempting to access `pageProps` before hydration. It also adds tests to prevent regressing on this

Closes: vercel#15647
@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants