Netlify not building all pages during deploy

Recently I have started having issues with my Netlify deployments.

I am getting the error:

5:52:31 PM: The build completed successfully, but the following processes were still running: 5:52:31 PM: ​5:52:31 PM: - node /opt/build/repo/node_modules/.bin/eleventy 5:52:31 PM: ​5:52:31 PM: These processes have been terminated. In case this creates a problem for your build, refer to this article for details about why this process termination happens and how to fix it. 

I have been through all of these support articles and still can’t find an answer.

I have tried clearing the cache and redeploying but all it does it only builds some of the site. Mostly pages are missing.

  • Failed Deploy Netlify App

  • Failed Deploy Netlify App

  • Most recent deploy that . It has all the files in the deployment download, they just aren’t showing on the production site.

To fix it I have to clear the cache multiple times on Netlify which means I can’t really use CI/CD.

Quick update, manually uploading my files to the server causes no issues.
I have tested by doing the initial upload, then making edits, and uploading the build. This leads me to think there is an issue with Netlify or the automatic caching Netlify is doing.

Hi, @tjperry07. In order for a site build to be deployed, the build command must “finish with a success”. To be considered, finished the running process must exit. The error message is saying that the build command has left running processes so it isn’t completing.

Our best recommendation would be to troubleshoot the build in the build-image to find out why your build doesn’t exit. Once the root cause is determined, you should them make changes to the build code so that it does exit.

Note, in most cases, this is caused by leaving open connections to databases or web servers. Including code to be sure to close the connection is the usual solution.

If there are other question about this, please let us know.

I did a lot of digging and Netlify seems to run based on the first process to finish. So to fix the issue update your NPM file to use && and thread your commands together.

My script uses npm run build. Most package.json build scripts look like this:
eleventy & npm run tailwind:build. Since Netlify seems to go off the first process finished, it was running tailwind then killing eleventy.

I updated my build script to be:
eleventy && npm run tailwind:build so it would wait for eleventy to finish then run tailwind.

TLDR;

& as in eleventy & npm run tailwind:build - means run both eleventy and npm run tailwind:build at the same time. I don’t care about which script finishes first just run them.

&& as in eleventy && npm run tailwind:build run eleventy wait for eleventy to finish, then run npm run tailwind:build

But keep your build times in mind

1 Like

Thanks so much for sharing this, @tjperry07 :netliconfetti: It will definitely be helpful should future Forums members find themselves encountering a similar situation.