Skip to content

Client error handler should not run on initial render #994

@bryanrsmith

Description

@bryanrsmith

I have a site that only supports modern browsers. Old browsers can still access the content thanks to server rendering, which is great. The problem is that Next currently renders an error page when an exception is thrown during render.

So, in an old browser:

  1. Navigate to the site
  2. Server renders the page
  3. Client displays the server-rendered page
  4. Client runs the client script. The page component uses an API like Object.assign, causing an exception to be thrown in the old browser.
  5. Next switches to the error view, hiding the original content.

My preference would be for Next to ignore exceptions during the initial page load so that old browsers will continue displaying the server-rendered content. I can work around this by loading polyfills (that I don't need for my target users), but it'd be nice if I could avoid this.

FWIW, I ran into this because Googlebot apparently runs a very old version of Chrome, and was seeing the error page after one of my views tried to use Object.assign.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions