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

500 errors flash due to markup mismatch #3865

Closed
1 task done
migueloller opened this issue Feb 21, 2018 · 4 comments
Closed
1 task done

500 errors flash due to markup mismatch #3865

migueloller opened this issue Feb 21, 2018 · 4 comments
Assignees

Comments

@migueloller
Copy link
Contributor

migueloller commented Feb 21, 2018

  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

When encountering an internal server error, it's expected that the server rendered markup matches the clients, thus avoiding flashing content.

Current Behavior

Currently internal server errors will cause a flash. More explicitly, the statusCode prop isn't present when rendering _error.js in the client, causing the markup to differ.

Steps to Reproduce (for bugs)

  1. Setup a simple Next.js project.
  2. Add a page pages/500.js with the following content:
export default () => { throw new Error('Boom!') }
  1. next build && next start
  2. Point a browser to http://localhost:3000/500.

Context

When deploying an application to production, internal server errors cause an unwanted flash of content.

Your Environment

Tech Version
next v5.0.1-canary.7
node v9.4.0
OS macOS v10.13.3
browser Chrome v64
@timneutkens
Copy link
Member

Please try next@canary

@migueloller
Copy link
Contributor Author

I've tried it with v5.0.1-canary.7 and still have the same issue. Updating the OP to reflect latest version.

@timneutkens timneutkens self-assigned this Feb 22, 2018
@mgiraldo
Copy link

mgiraldo commented Mar 9, 2018

i can reproduce in 5.0.1-canary.13

@timneutkens
Copy link
Member

Should be fixed now.

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

No branches or pull requests

3 participants