Next.js Discord

Discord Forum

How to get omitted error from sourcemaps enabled in production?

Unanswered
Belgian Hare posted this in #help-forum
Open in Discord
Avatar
Belgian HareOP
hi, i face this error in production but not at all in local env. in the global-error page i printed the error

"use client";

export default function GlobalError({
  error,
}: {
  error: Error & { digest?: string };
  reset: () => void;
}) {
  console.log(error);


So should i print error.digest to get the actual err message which has been omitted?
Image

7 Replies

Avatar
global-error.js is only enabled in production. In development, our error overlay will show instead.
you would get an error overlay instead
Avatar
Belgian HareOP
yes, but i'm unable to reproduce this in dev, and our tester faces this in prod. So how do i print the actual error?
Avatar
why don't you see the server logs?
Avatar
Belgian HareOP
oh oops you're right
i forgot that
Image