Skip to content

Instantly share code, notes, and snippets.

@ianjmacintosh
Last active September 2, 2020 00:46
Show Gist options
  • Select an option

  • Save ianjmacintosh/49dded90e93f943ceeb3ab56aa1c9efd to your computer and use it in GitHub Desktop.

Select an option

Save ianjmacintosh/49dded90e93f943ceeb3ab56aa1c9efd to your computer and use it in GitHub Desktop.
The Trouble with NetlifyCMS

My experience with getting NetlifyCMS working with my site was bad.

  • Added static files and JS reference to my homepage (??)
  • I got strange permissions errors from NetlifyCMS app and in my console. It was unclear to me what the root cause was, so I searched Google for the same error and found others encountering permissions issues and some Community staff members recommended re-deploying the application. I was a little wary of this, so I tried deploying to my preview environment, but figured maybe I'd have to redeploy the production build. It wasn't clear if the issue was with Netlify's Identity service, the GitHub integration (maybe related to my default branch being 11ty-migration but my Netlify authoritative branch is master), permissions within GitHub, or some issue with Git Gateway.
  • I wanted to redeploy my production build, but I was concerned that since my "11ty-migration" requires different build settings, redeploying would cause problems since I had set things differently in the Netlify UI when I initially deployed my production build. My build settings in the Netlify UI had since been changed to support 11ty. I crossed my fingers and tried it anyway, hoping re-running that build job would re-use the settings it had been given at the time. It did not
  • I tried fixing the issue by configuring the build parameters in my netlify.toml file, but the publish setting was being overridden by how it was set in the Netlify UI. Reluctant to change the UI settings back to support an old version of my site, I tried a few different things (clearing cache and re-running the build, double-checking my syntax in the configuration file, setting the publish directory in build settings to be exclusively applied to the deploy preview context) but in the end I had to run the production build with the old setting (publish directory) manually specified via the UI, then changing the setting back
  • After restoring my production build and unsuccessfully using the netlify.toml file to support different build settings, I went back to Googling the errors, concluding that I had to accept whatever would get fixed by re-deploying was not at fault. Eventually I determined the repo name (not editable) in the "Git Gateway" section of Netlify's UI for Identity settings was incorrect, so I removed Git Gateway and re-added it, seeing that this time it picked up the correct repo. As an aside, I wonder if I could've inadvertently been putzing around with the master branch from a different repo -- this wouldn't have been so obvious if I hadn't insisted on NetlifyCMS making changes to 11ty-migration
  • With Identity working, I found I could log in, but performing local development didn't work until I found a briefly-mentioned backend server I could run locally (I can't remember if it was in the official docs or Community)
  • I was able to view and edit my content, but the documentation for me to set up two collections (I think?) pulling from the same source was limited. It seems like the documentation gets you started, but unless you're building your platform on top of a starter project, you'll have to figure it out on your own
  • I've decided to cut my losses. This platform is not ready for primetime. Thank God I didn't have a paying client who wanted this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment