@@ -112,10 +112,14 @@ Create a [Custom Next.js Global Error component](https://nextjs.org/docs/app/bui
112
112
" use client" ;
113
113
114
114
import * as Sentry from " @sentry/nextjs" ;
115
- import Error from " next/error" ;
115
+ import NextError from " next/error" ;
116
116
import { useEffect } from " react" ;
117
117
118
- export default function GlobalError({ error }: { error: Error }) {
118
+ export default function GlobalError({
119
+ error ,
120
+ }: {
121
+ error: Error & { digest? : string };
122
+ }) {
119
123
useEffect (() => {
120
124
Sentry .captureException (error );
121
125
}, [error ]);
@@ -124,7 +128,7 @@ export default function GlobalError({ error }: { error: Error }) {
124
128
<html >
125
129
<body >
126
130
{ /* This is the default Next.js error component but it doesn't allow omitting the statusCode property yet. */ }
127
- <Error statusCode = { undefined as any } />
131
+ <NextError statusCode = { undefined as any } />
128
132
</body >
129
133
</html >
130
134
);
@@ -135,7 +139,7 @@ export default function GlobalError({ error }: { error: Error }) {
135
139
" use client" ;
136
140
137
141
import * as Sentry from " @sentry/nextjs" ;
138
- import Error from " next/error" ;
142
+ import NextError from " next/error" ;
139
143
import { useEffect } from " react" ;
140
144
141
145
export default function GlobalError ({ error }) {
@@ -147,7 +151,7 @@ export default function GlobalError({ error }) {
147
151
< html>
148
152
< body>
149
153
{/* This is the default Next.js error component. */ }
150
- < Error / >
154
+ < NextError / >
151
155
< / body>
152
156
< / html>
153
157
);
@@ -163,7 +167,7 @@ This means, that if you want to report errors that are caught by `error.js` file
163
167
import { useEffect } from " react" ;
164
168
import * as Sentry from " @sentry/nextjs" ;
165
169
166
- export default function Error ({
170
+ export default function ErrorPage ({
167
171
error ,
168
172
}: {
169
173
error: Error & { digest? : string };
@@ -187,7 +191,7 @@ export default function Error({
187
191
import { useEffect } from " react" ;
188
192
import * as Sentry from " @sentry/nextjs" ;
189
193
190
- export default function Error ({ error }) {
194
+ export default function ErrorPage ({ error }) {
191
195
useEffect (() => {
192
196
// Log the error to Sentry
193
197
Sentry .captureException (error);
0 commit comments