nextra
nextra copied to clipboard
Not working inside a monorepo
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.
have the same issue in nx. would be nice to be able to set an option for a custom path here.
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
My solution was that too, btw you should remove withNx
in next.config.js
. don't forget to add created .next
to .gitignore
cheers
Any recommendation how to solve this problem with a monorepo using yarn workspace?