Next.js Discord

Discord Forum

Build on Vercel fails but works locally

Answered
Sun bear posted this in #help-forum
Open in Discord
Sun bearOP
Dear all

I'm getting build error on vercel and not locally. Some packages are missing while building on the server:
`
...
This information is used to shape Next.js' roadmap and prioritize features.
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
https://nextjs.org/telemetry
- info Creating an optimized production build...
Failed to compile.
./src/lib/components/modal-mapping.tsx
Module not found: Can't resolve '@hookForm/resolvers/zod'
https://nextjs.org/docs/messages/module-not-found
....

You can find here attach my build log and my package.json.

This is driving me crazy as it is a simple project that is building and running just fine locally.
Answered by Rafael Almeida
you probably meant to import from @hookform/resolvers instead of @hookForm/resolvers (see the error message)
View full answer

2 Replies

you probably meant to import from @hookform/resolvers instead of @hookForm/resolvers (see the error message)
Answer
Sun bearOP
Thanks @Rafael Almeida ! It was the problem... Oh boy... What a painfull one to find... 😦