question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Next 9.5 monorepo production issue

See original GitHub issue

Bug 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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:18 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
samsislecommented, Aug 14, 2020

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!

3reactions
samsislecommented, Sep 2, 2020

@stevez86 It was released! → https://vercel.com/blog/monorepos 🎉

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found