Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Unrecognized front-matter format. + TypeError: e.commit is undefined #1272

Closed
ouarez opened this issue Apr 16, 2018 · 13 comments · Fixed by #1295
Closed

Error: Unrecognized front-matter format. + TypeError: e.commit is undefined #1272

ouarez opened this issue Apr 16, 2018 · 13 comments · Fixed by #1295
Assignees

Comments

@ouarez
Copy link

ouarez commented Apr 16, 2018


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"}
@ouarez
Copy link
Author

ouarez commented Apr 16, 2018

Sorry, I forgot the screenshots. Here they are!

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

@erquhart
Copy link
Contributor

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

@ouarez
Copy link
Author

ouarez commented Apr 17, 2018

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.

@erquhart
Copy link
Contributor

Yeah, ran with no issues.

@ouarez
Copy link
Author

ouarez commented Apr 18, 2018

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

@ouarez
Copy link
Author

ouarez commented Apr 18, 2018

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.

@ouarez ouarez closed this as completed Apr 18, 2018
@ouarez
Copy link
Author

ouarez commented Apr 18, 2018

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

@erquhart
Copy link
Contributor

Ah! We need better error messaging for that somehow.

@ouarez
Copy link
Author

ouarez commented Apr 18, 2018

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 :)

@tech4him1
Copy link
Contributor

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

@tech4him1
Copy link
Contributor

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.

@tech4him1 tech4him1 reopened this Apr 20, 2018
@tech4him1 tech4him1 self-assigned this Apr 20, 2018
@erquhart
Copy link
Contributor

Ah, good find on this one.

@tech4him1
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants