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?
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.
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.
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
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
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.
@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.