An error boundary is a React component pattern for handling rendering failures in descendant components. In production, it replaces blank screens with meaningful error messages and recovery actions. section 8.1.1
Use the pattern differently across development and production:
- Rely on the Next.js development error overlay to expose the call stack while debugging rendering errors. section 8.1.1
- Add an error boundary for deployed applications so users receive useful feedback and recovery call-to-action buttons. section 8.1.1
Figure 8.2 An error overlay shows whenever there is an error thrown in Next.js development mode. This helps catch problems early when developing the web application.
Compare the development overlay with the production experience an error boundary should provide. section 8.1.1


