open-next
open-next copied to clipboard
NX monorepo support
Hello, great work in creating this promising tool to run next using Serverless architectures outside of Vercel! :)
I am trying to use it together with NX's NextJS support in a monorepo project and I am trying multiple things, but I would like to start the investigation from the beginning, so what I have tried first:
- Just create a NX monorepo with a NextJS project
- Build it using PNPM and shamefully hoisting enabled
- Run the build command as below:
➜ derank git:(main) ✗ pnpm dlx open-next@latest build --build-command 'pnpm build' --app-path="./apps/frontend" --build-output-path="dist/apps/frontend"
Packages: +145
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 166, reused 145, downloaded 0, added 145, done
Error: next.config.js not found. Please make sure you are running this command inside a Next.js app.
So the first issue is that it can't find the next.config.js.
Am I doing anything wrong? Otherwise I can keep going with the more ways I have tried to make this work :)
Try following this: https://github.com/lorenzodejong/nx-open-next
Same here :(
Fixed in #474. This PR also added some docs https://open-next.js.org/config/nx