Next.js Discord

Discord Forum

how i can handle errors occurred on RootLayout are unhandled by error.tsx

Unanswered
Standard Chinchilla posted this in #help-forum
Open in Discord
Standard ChinchillaOP
I was testing, and if the RootLayout you throw a new random error for testing its not handled by the error.tsx as its show in the documentation. How i can handle those errors ??

5 Replies

Standard ChinchillaOP
yes tried that but not working at all
@Standard Chinchilla yes tried that but not working at all
well it is working for me so you need to show some code
"use client";

export default function GlobalError() {
  return (
    <html>
      <body>Global error</body>
    </html>
  );
}