mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
Adds extra context to errors that we think may have prevented validation: <img width="816" height="765" alt="Screenshot 2026-03-12 at 22 07 40" src="https://github.com/user-attachments/assets/35ce60d0-4840-496e-b91e-62ada4096f64" /> This is particularly useful for errors where the component comes from node_modules, so it gets ignore-listed. previously, all we got is the message with no stack, no we at least get a location. One notable case of this is `next/dynamic` with `ssr: false`. <img width="802" height="556" alt="Screenshot 2026-03-12 at 22 08 30" src="https://github.com/user-attachments/assets/b1240732-3346-4056-89b2-9a864a3166f2" />
9 lines
178 B
JavaScript
9 lines
178 B
JavaScript
'use client'
|
|
|
|
export function ErrorInSSRFromPackage({ children }) {
|
|
if (typeof window === 'undefined') {
|
|
throw new Error('Error from node_modules')
|
|
}
|
|
return children
|
|
}
|