nextra icon indicating copy to clipboard operation
nextra copied to clipboard

Not working inside a monorepo

Open Kerumen opened this issue 3 years ago • 4 comments

I have a Next.js app inside a monorepo and wanted to add Nextra.

Due to the this line, it tries to get all the pages from /path/monorepo/pages instead of /path/monorepo/apps/next-app/pages so it throws a rejection.

Kerumen avatar May 07 '21 13:05 Kerumen

have the same issue in nx. would be nice to be able to set an option for a custom path here.

brandoncroberts avatar Feb 03 '22 14:02 brandoncroberts

I had success in Nx specifically by using the generic "run-commands" executor instead of the built-in Next executors and then setting the cwd so Nextra can find the pages.

For example in project.json:

"serve": {
    "executor": "@nrwl/workspace:run-commands",
    "options": {
      "command": "npx next dev",
      "cwd": "apps/next-app"
    },
 },

ericponto avatar Feb 24 '22 14:02 ericponto

@ericponto

My solution was that too, btw you should remove withNx in next.config.js. don't forget to add created .next to .gitignore

cheers

always-maap avatar Feb 25 '22 01:02 always-maap

Any recommendation how to solve this problem with a monorepo using yarn workspace?

zehfernandes avatar Jun 23 '22 21:06 zehfernandes