NextJS build issue
Hello !
I've been playing around with Dokploy to test its capabilities, and so far, I'm quite impressed.
I'm currently building a test NextJS application. It was working fine after some trial and error, but suddenly, NextJS seems to be skipping the build process...
As a result, the
next start
command isn't working:
For reference, here's an example of the expected log output on my local machine:
I've tried pruning all Docker volumes, images, containers, and build cache, but the issue persists. :/
Thanks in advance for your help!16 Replies
The logs on my local machine :
Are you using nixpacks?
no i'm using a docker file.
here's the content of the file :
Well, if I were you, I would use the dockerfile made by nextjs devs
GitHub
next.js/examples/with-docker/Dockerfile at canary · vercel/next.js
The React Framework. Contribute to vercel/next.js development by creating an account on GitHub.
Or you can simply use nixpacks, it will automatically detect that you're using nextjs and deploy it as a nextjs app as if you deployed on vercel
i tryied using nixpacks as you suggested but i got the following error :
Are you sure pnpm-lock.yaml exists in your repo?
yes ^^
i've checked on github in the case i've misconfigured something and he file is there
i've fixed the problem by specifying the exact version of pnpm in the package.json file
I've ran into another issue where i need some additional packages (
python3 make g++ libpq-dev
) but i didn't found in the documentation if it is possible to pass arguments to nixpacks like showed here : https://nixpacks.com/docs/guides/configuring-buildsConfiguring Builds | Nixpacks
App source + Nix packages + Docker = Image
In my case for docs and website I use a dockerfile https://github.com/Dokploy/dokploy/blob/canary/Dockerfile.website for nextjs app
GitHub
dokploy/Dockerfile.website at canary · Dokploy/dokploy
Open Source Alternative to Vercel, Netlify and Heroku. - Dokploy/dokploy
if you want to specify custom arguments create a nixpacks.toml and automatically nixpacks will detect it
If I remember correctly I faced similar situation, with pnpm 9 and nixpacks. I have to stay with pnpm 8 to avoid it. I will try to find the github issue.
GitHub
Support for pnpm v9 · Issue #1091 · railwayapp/nixpacks
Is there an existing issue for this? I have searched the existing issues Describe the bug When upgrading our service to use pnpm v9, nixpacks is still using pnpm v8 package.json "engines"...
You can use a workaround by creating a
nixpacks.toml
file in the root directory of your project with this content: