Dato CMS / Netlify Build Trigger Not Working

Hello Netlify Community,

I’m hoping someone can help with a build issue I’m having.

I’m using Dato CMS and have set up a build trigger so it connects with Netlify.

My site URL is: https://limelighteventservices.com/

Everything looks good in Dato CMS as I get a ‘Publication completed with success!’ message in Dato CMS when I click ‘Build Now’.

When I look at the deploy summary in Netlify it also appears to be successful which makes it harder to troubleshoot.

One thing I have noticed is that when I click on ''Open Production Deploy" it opens;

But the (text) changes I’ve made in Dato CMS aren’t reflected there either!?

I’m hoping its just a deployment setting that’s causing the issue. (See settings attached)

Any help would be greatly appreciated!


Richard Gill

Hiya Richard,

If those actions in DatoCMS are triggering a build and those are visible in your deploys view, that part of the setup should be fine. But I notice that you don’t appear to have a build command set. Is a build command specified in your netlify.toml instead, and does triggering a build from your deploy page in the Netlify UI result in a good build?

Hello Phil,

Thanks for the response.

I didn’t have a build command set and had a quick look at the Netlify docs and added ''npm run build".

I then went back to Dato CMS and hit the “Build Now” button which resulted in a build error.

I’ve attached a screenshot of the log.

Any suggestions would be great!

Thanks again,


Aha. Ok.

So now at least we can see that a build is trying to run, where as before it was not trying to do anything. That error now tells us that your build fails. Some things to check:

  • What is your build? You’ve now told Netlify to run the build command you’ve specified in your package.json, but what is that calling, and is that same build command do you run locally on your site in development?

  • Does your build run successfully in your local development environment?

You may get more insight by looking at the deploy logs in Netlify rather than the response to your build hook over in Dato CMS. The key seems to be that your builds are not successful (no matter where thet are triggered from).

As a reminder, you can trigger deploys directly from the deploys page of your Netlify UI, which might be more convenient for reviewing the deploy logs and looking for errors in your build.

Hello Phil,

Yes, so locally I use “npm run build” and that works fine.

I had a look at my package.json and the build command I see there is;
“build”: “astro build && pagefind --site dist”,

I updated my netlify build settings to this and got the same error as before. (I also updated it to just “astro build” with the same result).

Looking at the netlfy log (attached) it seems to be cause by a missing file or directory as it can’t read the package.json file.

Any suggestions are more than welcome!

Thanks again,

Richard Gill

Yes it does indeed look like Netlify can’t see your package.json file. Is that in the project base directory? And is the base directory set to / or somewhere else in the netlify config?

Your repo is private so I can’t snoop around there to see :slight_smile:

Hello Phil,

I’m using Astro as the framework and run a build each time before uploading to the repo.
I’ve just checked the repository and couldn’t see a package.json file in there.

I’ve uploaded it manually and changed the netlify build settings to “astro build”.
When I go back to Dato CMS I get a successful build message and a successful deploy message in Netlify.

But still no changes on the front end however! :unamused:

The base directory in Netlify is / and I’ve made the repo public now if need to have a look.

Thanks again,

Richard Gill

I think I see what’s going on here.

There’s a slight misunderstanding about what should go into the repo and how Netlify deploys a site for you. Let me see if I can help…

Currently, you are running a build locally, and then taking what that build generates and uploading it to your GitHub repo. You are also pointing Netlify at that root of that repo and asking it to host that for you as your site. That works fine, but you have to run that build and upload each time you want to update because Netlify has no sight of your source code for generating the site.

However, Netlify can run that build for you, take the output, and host it. That’s what we need to get rolling.

So, rather than your repo containing the output from your Astro site build, it needs to contain the project code itself so that Netlify can run the same build operation you currently run locally, and thus get access to the new output.

It looks like you are perhaps uploading the content that running astro build generates into a dist folder or similar, to GitHub. That would be why your package.json file could not be found until you manually added it. It actually resides at the root of your project.

You’ll need to have the entire project directory, and not just the contents of the dist folder, in your git repo, and then you can tell Netlify to publish what your project builds either through the UI (see the setting for “Publish directory”, below), or in your netlify.toml (which also needs to be at the root of your project )

You can exclude things like the hefty node_modules and dist directories from your repo by listing them in a .gitignore file. They’ll be populated in Netlify’s builds just as the would be locally for you when you run npm install and astro build

Does that help?

Brilliant! Thanks Phil, I’ll give that a go

Hello Phil,

I’ve just got around to looking at this again and it worked!

Thanks so much for your help. The feeling it gave me when I saw it working for the first time was pure elation! :grinning:


Richard Gill

Hi richard, glad to hear you were able to resolve your issue. Thanks for writing back in.