coollabsio / coolify

An open-source & self-hostable Heroku / Netlify / Vercel alternative.
https://coolify.io
Apache License 2.0
33.1k stars 1.77k forks source link

[Bug]: Incorrect Build Path for Next.js App with Nested app Folder #2404

Open RiCatarino opened 4 months ago

RiCatarino commented 4 months ago

Description

In the Coolify app, there's an issue when building a Next.js application using Nixpacks. If the Next.js app has a nested app folder, like /app/app, intended for routing to https://url/app, Nixpacks incorrectly points to the subfolder instead of the main folder. This misconfiguration results in the failure to check the health status of the application. If this is an issue with Nixpacks directly, please close the issue and i'll create one at their repo. I was able to fix this by creating a route group like app/(routetoapp)/app.

Minimal Reproduction (if possible, example repository)

  1. Create a Next.js project with the new app router.
  2. Inside the main app folder, create a subfolder also named app (i.e., /app/app).
  3. Deploy the application using Coolify and Nixpacks.

Exception or Error

It fails the healthcheck.

Version

v4.0.0-beta.294

rdewolff commented 4 months ago

I am having issues with monorepo and subfolder too.

Anyone care to help?