New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpected behavior with next build executor and outputPath. Resulting in vercel deployment error: "routes-manifest.json couldn't be found" #23022
Comments
FWIW, there is someine in the Discord forum also running into this issue. |
After you made your changes to Meaning only inside |
Tried that multiple times without success. The build output continues to be split between |
Update TLDR New projects (generated with NX V14). are unable to reproduce the behavior described in this issue. However, my original Next.js project which was generated with and older version of NX does exhibit the problem described in this issue. Detailed update Here is an update on this whole saga. Some context - the Second - this week we added a brand new Next.js project. When configuring our CI/CD I replicated the configuration that worked in dora-whitelabl-web-app (see issue description. TLDR: setting the output to a .next folder within the project, instead of the dist folder. Something like:
My first instinct was to set the Solution to this new problem Finally, I realized the package.json was part of the build output. So I configured the output of the However, the original |
This issue has been automatically marked as stale because more information has not been provided within 7 days. |
At least 3 of us are stuck on this still. |
Current Behavior
When my Next's project configuration points to an output path in the dist folder at the root of the monorepo I end up with part of my build output in the correct dist folder (the nx part) and the other part (the next.js files, the actual applization) ends up in the .next folder within my project.
The command I am using is:
npx nx build dora-whitelabel-web-app --prod --verbose --skip-nx-cache
Here is my project.json:
And the output folders look like this:
The project's folder:
The dist folder:
As a result of this my deployments to Vercel using the CLI are failing with the error:
Error: The file "/vercel/path0/dist/apps/dora-whitelabel-web-app/.next/routes-manifest.json" couldn't be found. This is often caused by a misconfiguration in your project.
Solution:
point the output path to the .next file inside the project:
Expected Behavior
The output of the build (all of it, NX and Next.js files) should be dropped in the location specified in the outputPath of the project.json
GitHub Repo
No response
Steps to Reproduce
Nx Report
Failure Logs
No response
Package Manager Version
No response
Operating System
Additional Information
As a bonus: it seems like the nx cache is not working inside vercel even though in there i do not have the --skip-nx-cache flag.
The text was updated successfully, but these errors were encountered: