next-plugin-preact icon indicating copy to clipboard operation
next-plugin-preact copied to clipboard

Fails to render pages/_error when exception is thrown in CSR

Open wilsonpage opened this issue 4 years ago • 0 comments

Describe the bug When an exception is throw in the render phase of a clientside rendered page the Next.JS pages/_error fails to render. I'm unsure if this is a bug in next, preact or next-plugin-preact happy to post elsewhere if there's a better place.

To Reproduce

  • Repro: https://nextjs-preact-demo-wilsonpage.vercel.app/
  • Source: https://github.com/wilsonpage/next-preact-error-handling-bug

Steps to reproduce the behavior:

  1. Visit /
  2. Click link to render /failing
  3. Observe fails to JS console showing 5x render and exceptions

image

Expected behavior

  • Should only invoke pages/failing render once
  • Should then render pages/_error

wilsonpage avatar Jul 23 '21 14:07 wilsonpage