Next.js Discord

Discord Forum

Next 13 app dir error.tsx causing build error

Unanswered
Chinese Alligator posted this in #help-forum
Open in Discord
Chinese AlligatorOP
Hi all. I hope somebody can help me with this. I'm trying to add error.tsx and it works on local machine. but when I deploy the project to vercel, I get error (pic attached)

Next.js version: 13.4.7
Nx mono repo

10 Replies

Chinese AlligatorOP
already added 'use client' directive but error still persists. on local it works fine but errors in vercel 🤷‍♂️
have you tried building locally with npm run build?
if it fails, try to rebuild again on vercel without build cache
Chinese AlligatorOP
yup local build works. I also disabled vercel cache with VERCEL_FORCE_NO_BUILD_CACHE but still no luck
weird... can you install the vercel CLI and try to deploy from the CLI in your local computer?
Chinese AlligatorOP
will try this
Chinese AlligatorOP
build errors on vercel build but no useful message on logs 😦
then i would contact support or go to vercel discussions https://github.com/orgs/vercel/discussions; if it can build locally this is a vercel problem and we can't really do anything