Next.js Discord

Discord Forum

Builds fine on dev and test, fails on prod (Next.js, Tailwind/ShadCN, Vercel)

Unanswered
Thrianta posted this in #help-forum
Open in Discord
ThriantaOP
I'm hoping someone here has had a similar issue and knows of a solution... My project builds and deploys on all pre-production branches no problem. Dev, Test, and all previews, all good. But when I tried to do a Production release, it fails to build with errors with not able to find my UI modules (tailwind/shadCN). One thing I noticed as well was during the build, it installs almost 200 less packages? I'm at my wits end, I've tried not using a cached install, renaming the components package incase it was a case sensitive issue, using direct path instead of alias. Not sure what else I can do...

5 Replies

ThriantaOP
Like merging main back to test, works fine, builds fine, I don't understand....
ThriantaOP
Another example, using the Vercel CLI with the exact same commit and branch.

Preview is fine, production explodes.
ThriantaOP
I figured it out… It has to do with either the new Next.js or Vercel CLI with how they build production deployments. It required that all “dev dependencies” to be actual dependencies… which is strange as heck… That has to be a bug of some sort. Who do I tag to take a look into this? &752637460550385834
tested it with individual packages, one at a time