open-next icon indicating copy to clipboard operation
open-next copied to clipboard

NX monorepo support

Open caioquirino opened this issue 1 year ago • 1 comments

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 :)

caioquirino avatar Oct 17 '23 16:10 caioquirino

Try following this: https://github.com/lorenzodejong/nx-open-next

khuezy avatar Oct 17 '23 16:10 khuezy

Same here :(

jarodsim avatar Jun 03 '24 19:06 jarodsim

Fixed in #474. This PR also added some docs https://open-next.js.org/config/nx

conico974 avatar Jul 20 '24 08:07 conico974