Netlify-cms: Error: Unrecognized front-matter format. + TypeError: e.commit is undefined

Created on 16 Apr 2018  ·  13Comments  ·  Source: netlify/netlify-cms


BUG REPORT INFORMATION

- Do you want to request a feature or report a bug?
Report a bug.

- What is the current behavior?
Nothing works. Maybe I'm just tired but I can't get Netlify to work and keep running into these 2 errors.

- If the current behavior is a bug, please provide the steps to reproduce.

  • Start up a fresh Jekyll Project.
  • Add the Netlify CMS code to the /admin folder (config.yml + index.html)
  • add the required scripts to the default layout
  • create a new repo with Github, launch the site with Netlify
  • visit mywebsite.netlify.com/admin, log in

- What is the expected behavior?

I keep running into strange error console messages and 404 network errors. I can't post new pages, and I can't upload images. Basically, nothing works and I don't understand the errors the console has thrown at me.

Thinking I must have done a mistake setting up Netlify CMS, I cloned one of my previous projects (which is also using Netlify CMS, and everything is working fine) and deployed it using Netlify, with a temporary URL.

When I log in to this new, freshly cloned website, I get the same errors.. even though the code is identical as my currently working project.

I'm stumped, since the code and configuration are identical. Yet, on any freshly deployed Netlify websites, the Netlify CMS isn't working for me, at all.

I'm going to try adding a custom domain to these new instances, since that is the only difference I can think of between the new projects and the old, working one.

Please take a look at the included screenshots for the error messages.

INFO:

Netlify CMS version 1.5.0
Client-side Node: v8.11.0
Netlify-side Node: node v8.11.1 (npm v5.6.0)
OS: Fedora 26 (x86-64)

- Please link or paste your config.yml below if applicable.

(I don't think this is an issue with the config.yml, but here it is just in case I made an obvious mistake?)

backend:

  name: git-gateway
  branch: master # Branch to update (optional; defaults to master)

media_folder: "img"

collections:

  - name: "special-pages"
    label: "Pages uniques"
    delete: false # Prevent users from deleting documents in this collection
    files:
      - name: "home"
        file: "index.md"
        label: "Éditer la page d'accueil"
        fields:
          - {label: "Layout", name: "layout", widget: "hidden", default: "home"}
          - {label: "Title", name: "title", widget: "string"}
          - {label: "Permalink", name: "permalink", widget: "hidden", default: "/" }
          - {label: "Description", name: "description", widget: "string"}
          - {label: "Paragraphe d'introduction", name: "home_intro", widget: "markdown"}
          - {label: "Paragraphe pour matériel premier soins", name: "home_materiel", widget: "markdown"}
          - {label: "Lien vers matériel premier soins", name: "link_materiel", widget: "string"}
          - {label: "Paragraphe pour formations", name: "home_formations", widget: "markdown"}
          - {label: "Lien vers formations", name: "link_formations", widget: "string"}

Most helpful comment

There seems to be two states that /.netlify/git/github/branches/master can be in. If Git Gateway was on, and then was turned off, it will return a JSON response {"code":404,"msg":"Unable to locate site configuration"}. However, if it never was turned on, it will return a HTML 404 page (without any CORS headers). We should catch it either way, but we don't seem to be, and that is why the CMS will log in anyway. If necessary, we can check the API root directly /.netlify/git/github/, since it always returns the JSON response.

All 13 comments

Sorry, I forgot the screenshots. Here they are!

netlify-bug1
netlify-bug2
netlify-bug3
netlify-bug4

I forked your repo and couldn't reproduce. Can you paste index.md?

index.md only contains basic code:

layout: home
---

And nothing else.

You say you got an OK result from forking my repo?

I'll try it again tomorrow morning. Maybe it's just me and I had a bad day.

Yeah, ran with no issues.

I'm still running into the same error.

To be clear, you forked my "tdc-jekyll" repo, deployed it with Netlify, and were able to login to the Admin section and use the CMS without issues?

It's driving me nuts but I'll keep trying stuff until I figure it out.

I'll close this issue in a few hours if I still can't find the problem (or if I find my problem)

Cheers

I'm convinced the errors have something to do with the 404 network errors.

Would there be any reason that links at http://domain.netlify.com/.netlify/git/github wouldn't be found?

netlify-bug

Maybe it's my Netlify settings... It's got to be specific to me, which makes this even more frustrating :)

But it's probably not an issue with Netlify CMS.

Thanks anyway for your help. I'll close this issue and figure it out on my own.

Annnnnd it was 100% my fault and an issue with the Netlify settings, as I initally suspected

These errors were a result of me forgetting to enable the Git Gateway Service in Settings/Identity

So obviously, without access to the Git repo, nothing was working. This explains the 404 errors.

I had simply forgotten it was necessary to enable this setting. My bad!
enable-git

Ah! We need better error messaging for that somehow.

At least now when I google the console error I had (Unrecognized front-matter format.), I get this thread as a result. Maybe it'll help the next person who forgets to enable the Git gateway :)

It looks like /.netlify/git/github/branches/master is returning a 404, and sometimes we aren't catching it. Checking into it.

There seems to be two states that /.netlify/git/github/branches/master can be in. If Git Gateway was on, and then was turned off, it will return a JSON response {"code":404,"msg":"Unable to locate site configuration"}. However, if it never was turned on, it will return a HTML 404 page (without any CORS headers). We should catch it either way, but we don't seem to be, and that is why the CMS will log in anyway. If necessary, we can check the API root directly /.netlify/git/github/, since it always returns the JSON response.

Ah, good find on this one.

Looks like the code issue is that we only throw on 404 errors if the response is JSON. 🤷‍♂️

Was this page helpful?
0 / 5 - 0 ratings