Deploying NextJS, with NX monorepo on a Manual deployment (through CLI)

Hi,

I have a mono repo with 2 websites. I use Nx for the monorepo, and Next.js for both website.
The folder structure is as such:
/apps/site1/… (src and next config)
/apps/site2/… (src and next config)
/dist/apps/site1/… (output of the nextjs build)
/dist/apps/site2/… (output of the nextjs build)

The website use SSR and i18n, so I cannot use the next export feature, so I build the sites with a classic next build (I’m sure it’s working since I was deploying that on my netlify account before migrating to mono repos).

Then I use netlify cli from the root of my monorepos, with a manual deployment such as:
netlify deploy --dir=dist/apps/site1 --site SITE-ID --auth AUTH-TOKEN --build --json

The problem is that netlify-cli only upload 2 files (in deployment ui history), and the url display a netlify message error like if no pages or nothing was deployed:
“Page Not Found
Looks like you’ve followed a broken link or entered a URL that doesn’t exist on this site.”

I’ve look for documentation about how to handle monorepo with next, but all I could find use netlify auto deployments, and not manual deployments with the CLI. Does anyone see where I messed up, or do you know of an example next mono-repo with netlify-cli commands example to deploy on manual deployed sites ?

Thank you,

Hey there, @YannT :wave:

Thanks for reaching out! Can you please share the URL to your site that is encountering this obstacle as well as your full deploy log? This will help us look into this further.