Open
Description
Describe the Bug
Environment info.
node: 20.18.0
next.js: 14.2.22
I wanted to deploy the next.js + TS project on vercel, but I got this error.
TypeError: Cannot create property 'digest' on string 'Something went wrong!'
My project is using app router.
It occurs in app/product/[id]/error.tsx
The code is as following.
`'use client';
import Button from '@mui/material/Button';
import Container from '@mui/material/Container';
import { paths } from 'src/routes/paths';
import { RouterLink } from 'src/routes/components';
import { Iconify } from 'src/components/iconify';
import { EmptyContent } from 'src/components/empty-content';
// ----------------------------------------------------------------------
export default function Error({
error,
reset,
}: {
error: Error & { digest?: string };
reset: () => void;
}) {
return (
<Container sx={{ mt: 5, mb: 10 }}>
<EmptyContent
filled
title="Product not found!"
action={
<Button
component={RouterLink}
href={paths.product.root}
startIcon={<Iconify width={16} icon="eva:arrow-ios-back-fill" />}
sx={{ mt: 3 }}
>
Back to list
</Button>
}
sx={{ py: 10 }}
/>
</Container>
);
}`
On local env, there is no bug, but on deployment, this issue occured.
Please help to fix this issue.
Thanks.
Link to the code that reproduces this issue
yarn install, yarn build, yarn start.
Reproduction Steps
No response.
Which area(s) are affected? (Select all that apply)
Not sure
Environment Info
node: 20.18.0
next.js: 14.2.22