next js 14 convex deployment
Hello everyone, I need some help in deploying the convex project with next.js 14 app to production.
Here is a error log
22:20:22.363] This information is used to shape Next.js' roadmap and prioritize features.
[22:20:22.363] 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:
[22:20:22.363] https://nextjs.org/telemetry
[22:20:22.363]
[22:20:22.428] ▲ Next.js 14.2.5
[22:20:22.428]
[22:20:22.504] Creating an optimized production build ...
[22:20:48.747] Failed to compile.
[22:20:48.747]
[22:20:48.747] ./app/(routes)/dashboard/layout.tsx
[22:20:48.747] Module not found: Can't resolve '@/convex/_generated/api'
[22:20:48.747]
[22:20:48.747] https://nextjs.org/docs/messages/module-not-found
[22:20:48.747]
[22:20:48.747] ./app/(routes)/dashboard/page.tsx
[22:20:48.747] Module not found: Can't resolve '@/convex/_generated/api'
[22:20:48.747]
[22:20:48.747] https://nextjs.org/docs/messages/module-not-found
[22:20:48.747]
[22:20:48.747] ./app/(routes)/teams/create/page.tsx
[22:20:48.747] Module not found: Can't resolve '@/convex/_generated/api'
[22:20:48.747]
[22:20:48.748] https://nextjs.org/docs/messages/module-not-found
[22:20:48.748]
[22:20:48.748] ./app/(routes)/workspace/[workspaceId]/_components/Canvas.tsx
[22:20:48.748] Module not found: Can't resolve '@/convex/_generated/api'
[22:20:48.748]
[22:20:48.748] https://nextjs.org/docs/messages/module-not-found
[22:20:48.748]
[22:20:48.748] Import trace for requested module:
[22:20:48.748] ./app/(routes)/workspace/[workspaceId]/page.tsx
[22:20:48.748]
[22:20:48.748] ./app/(routes)/workspace/[workspaceId]/page.tsx
[22:20:48.748] Module not found: Can't resolve '@/convex/_generated/api'
5 Replies
Do you have convex/_generated folder checked in to your Git repo?
yes I did
What happens when you run the build (not dev) command locally, does it work?
it works
have you committed these files, if you use GitHub can you see these files there? You could try not using
@
import aliases and instead using the relative path to the convex directory, just for debugging.