Skip to content

Commit 52cec4f

Browse files
committed
fix(site): address error page review feedback
1 parent ea812c7 commit 52cec4f

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

apps/site/app/[locale]/error.tsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,7 @@ type ErrorPageProps = {
1414

1515
const ErrorPage: FC<ErrorPageProps> = ({ error }) => {
1616
const t = useTranslations();
17-
const errorDetails = [
18-
error.message,
19-
error.digest && `digest: ${error.digest}`,
20-
]
21-
.filter(Boolean)
22-
.join('\n');
17+
const hasErrorDetails = Boolean(error.message || error.digest);
2318

2419
return (
2520
<GlowingBackdropLayout kind="default">
@@ -33,14 +28,17 @@ const ErrorPage: FC<ErrorPageProps> = ({ error }) => {
3328
{t('layouts.error.internalServerError.description')}
3429
</p>
3530

36-
{SHOW_ERROR_DETAILS && errorDetails && (
31+
{SHOW_ERROR_DETAILS && hasErrorDetails && (
3732
<details className="max-w-2xl rounded-lg border border-neutral-300 bg-neutral-950/90 px-4 py-3 text-left text-neutral-50">
3833
<summary className="cursor-pointer font-medium">
3934
{t('layouts.error.details')}
4035
</summary>
4136

4237
<pre className="mt-3 overflow-x-auto font-mono text-xs leading-6 break-words whitespace-pre-wrap">
43-
{errorDetails}
38+
{error.message}
39+
{error.digest
40+
? `${error.message ? '\n' : ''}digest: ${error.digest}`
41+
: ''}
4442
</pre>
4543
</details>
4644
)}

apps/site/next.config.mjs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@ const nextConfig = {
2929
basePath: BASE_PATH,
3030
// Vercel/Next.js Image Optimization Settings
3131
images: getImagesConfig(),
32-
env: {
33-
NEXT_PUBLIC_VERCEL_ENV:
34-
process.env.NEXT_PUBLIC_VERCEL_ENV || process.env.VERCEL_ENV,
35-
},
3632
serverExternalPackages: ['twoslash'],
3733
outputFileTracingIncludes: {
3834
// Twoslash needs TypeScript declarations to function, and, by default, Next.js

0 commit comments

Comments
 (0)