Next 9.5 monorepo production issue
See original GitHub issueBug report
After updating to 9.5, next no longer works in my current monorepo setup on a deployment to vercel. Everything appears fine in development, however once I deploy to vercel the issue is exhibited by the home page redirecting to a path identical to the routing setup to the routes field in the now.json. In this case, the homepage is redirected to /my-app
Here is a link to the reproduction: https://github.com/stevez86/next-repro-2 And a link to a deployment: https://my-app-nsgjc5j8l.vercel.app/
Here is my now.json file, which I think is the culprit. The other app routes appear to be working as intended ie /abc/:slug1/:slug2 so I think this is only applicable to the homepage route at “/”.
{
"version": 2,
"builds": [{ "src": "my-app/next.config.js", "use": "@now/next" }],
"routes": [{ "src": "/(.*)", "dest": "/my-app/$1", "continue": true }]
}
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:18 (2 by maintainers)
Top Results From Across the Web
Next.js 9.5 Improves Static Site Regeneration Performance
Next.js, the open-source React-based framework from Vercel, adds several static site generation performance improvements in the Next.js 9.5 ...
Read more >next-transpile-modules - npm
This plugin aims to solve the following challenges: code transpilation from local packages (think: a monorepo with a styleguide package); code ...
Read more >Learn how to build a monorepo in Next.js - LogRocket Blog
A monorepo is a single version-controlled repository that contains several isolated projects with well-defined relationships.
Read more >Blog - Incrementally Adopting Next.js
Next.js, the React framework for production, enables you to incrementally adopt React. Motivation.
Read more >Unable to deploy a Next.js monorepo using workspaces to ...
The issue seems to be with using npm workspaces with Next.js... When I switched over to a minimal POC using yarn workspaces it...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello,
We don’t recommend attempting to make monorepos work via a
vercel.json
file — it’s simply a pain attempting to make the routing work.We are testing Monorepo Support internally without the need for a
vercel.json
file. Stay tuned for an announcement in the coming days!@stevez86 It was released! → https://vercel.com/blog/monorepos 🎉