Gridsome Site Deployment Failure

My site works perfectly well locally and I’m able to get into Netlify CMS okay. I’ve also cloned my repo to make sure that everything is exactly the same.

However, the site fails on Featured Image query, even though it is all there.

It seems that Netlify is loading old build instructions, because the Yarn version that I’m using is 1.16 and Netlify loads 1.13.

Is this just to do with the error message we’ve been getting from Netlify and I simply have to sit it out?

If you’re seeing old commands have you tried the clear cache and deploy option?

image

It’s sorted now thanks, but yes I did try clearing the cache.

I’ve updated this because my problem was due to file paths not being exactly the same. They need to be case-matched as Windows isn’t case sensitive, but Linux is.

Thats a really interesting way of deploying :thinking:

How come you’ve decided to track your build output in version control? I see you mentioned you have more control over things, how do you mean?

Oh, I’m no expert on version control. The only reason I’m using Git is because that’s what they recommend at Gatsby and Gridsome when you create a starter site.

It’s not really the version control I’m interested in for a simple site, but it makes it reliable I suppose when I’m learning JavaScript and just need something that works.

As for more control that’s what it says in the Netlify toml guide. I guess they mean over build commands and headers and redirects.

I suppose now it’s all working properly I can deploy directly from my laptop, because that syncs with Git and Git syncs with Netlify.

What kind of tools have you tried yourself?

So generally any generated content is not included in the repo apart from some instances like package-lock.json or yarn.lock.

As netlify has access to your repo, you don’t need to commit the output of your build command to github as these generated files will never be used in production.

Once netlify clones your repo, the command you put in your toml file will be used, you have “echo ‘yarn build’” (this can just be command = “yarn build” btw) and then serve your site from whichever directory you’ve set to be public in your toml

Well I was deploying it like you suggest, because I realised that Netlify build the site themselves, but I kept on getting errors.

None of the issues Netlify’s platform has experienced are likely to cause a build that worked once to stop working for the long term, so I don’t think they are relevant here.

As @omonk mentioned, the usual method of deploying your site is to commit the source code and let us build the rest, but you don’t have to do that. Do what works for you :slight_smile:

In your situation, though, I wouldn’t deploy from git at all but since you have the site built locally you could skip the commit of the built resources, and just deploy directly using our CLI:

Sorry, I don’t want to be giving out bad information. Is it best to delete this entire thread?

Like I say, this was meant as a band aid for people who were stuck like myself.

I was using the standard method, but then I couldn’t get it to work, even though it worked locally and the data was exactly the same.

After noticing people were using a .toml file I read the instructions in your .toml guide and it does state: “the deploy ready files generated by the build”. So I followed that piece of advice and it worked.

Secondly, my error, I didn’t know how to push to Github from the command line so did the cloning part a bit convoluted and unnecessary.

To be honest, I got into all this from a Gridsome Netlify CMS guide so jumped into learning them both at the same time. That guide tells you to link up with Github.

I will try your command line tools. Thanks for the suggestion.

And apologies for misleading people, if that’s your concern. That’s the last thing I wish to do.

Just wanted to say that I found my answer, so can now go back to deploying the correct way, you’ll be glad to hear. :slight_smile:

Windows isn’t case sensitive, but Linux is so my sites were building fine locally, but failing on Netlify.

I’ve been pulling my hair out deleting everything, starting from scratch, etc, but it boiled down to ensuring my image file paths are the same.

Maybe it’s worth pointing this out in your docs, if you don’t already somewhere.

Cheers.

@omonk yes, my mistake, you only need to echo the ‘default configuration’. Then I guess you can change it in the Netlify settings and the .toml file will reflect that.

Glad you found your solution! we do mention case sensitivity in our docs, though there’s certainly a lot to wade through.