- Do you want to request a feature or report a bug?
Bug
- What is the current behavior?
Error loading the CMS configuration
The config.yml file could not be loaded or failed to parse properly.
Error message: Error: Error in configuration file: A
media_folderwasn't found. Check your config.yml file.
- If the current behavior is a bug, please provide the steps to reproduce.
Basically, it's easy enough, I run a jekyllized setup (a yo template) https://github.com/sondr3/generator-jekyllized
With the project's structure in mind I placed the admin folder in src (it gets sent to dist ok). I can deploy dist and that's all good. However,
with my netlify-cms setup it simply errors out as above.
My config is
backend:
name: github
Path to your Github repository (blanked out on purpose)
branch: optimize # Branch to update
publish_mode: editorial_workflow
media_folder: "src/assets/images/featured"
public_folder: "assets/images" # The src attribute for uploaded media will begin with /images/uploads
Exact steps to reproduce:
install the generator (use yarn or npm)
$ yo jekyllized
$ bundle
# Place admin folder with config as described.
$ gulp build --prod
# Pre-assuming the correct netlify config ahs been done with nelify init
$ netlify deploy
# Watch and tear hair out at error.
- What is the expected behavior?
It should work..
Hi @HaoZeke
Is your config.yml in the same folder as the index.html for Netlify CMS?
Are there any errors in the JavaScript Console in your browser?
@josephearl yup it's in the same folder... I experimented by removing lines to see if it was reading it at all but it seems like it is (the error changes when I empty the entire config.yml which means it's obviously doing something with it...)
There are no errors on the console.
The only thing which shows up on the console is
Netlify CMS version 0.3.20
Also, I tried changing the backend to netlify-git-api serve but got the same issue..
I think I see the issue, you have media_folder indented under backend, but it should not be.
Can you try this config?:
backend:
name: github
# Path to your Github repository (blanked out on purpose)
branch: optimize # Branch to update
publish_mode: editorial_workflow
media_folder: "src/assets/images/featured"
public_folder: "assets/images" # The src attribute for uploaded media will begin with /images/uploads
Thanks so much @josephearl ... That gets me the login with github button...
I set up the Third-party application access policy as per the instructions...
However after authorizing it, nothing happens.
The console log is
TypeError: e.parentNode is null[Learn More] cms.js:15:7675
Actually that was a simple enough config error.... Done :D
I'll be opening a pr to add the sites I'm working on here in the examples soon... :)
Awesome 馃憦, what was it out of interest since we'd like to improve the error messages?
Basically I hadn't set up my collections...
collections: # A list of collections the CMS should be able to edit
- name: "posts" # Used in routes, ie.: /admin/collections/:slug/edit
label: "Post" # Used in the UI, ie.: "New Post"
folder: "src/_posts"
slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
create: true # Allow users to create new documents in this collection
fields: # The fields each document in this collection have
- {label: "Title", name: "title", widget: "string", tagname: "h1"}
- {label: "Publish Date", name: "date", widget: "datetime", format: "YYYY-MM-DD hh:mma"}
- {label: "Cover Image", name: "image", widget: "image", required: false, tagname: ""}
- {label: "Body", name: "body", widget: "markdown"}
meta:
- {label: "SEO Description", name: "description", widget: "text"}
card: {type: "image", image: "image", text: "title"}
Adding that fixed it.
However it won't save.
Failed to merge: API_ERROR: Reference does not exist
Also, it seems rather slow, is self hosting suggested?
Also, very very very importantly. It doesn't save a local copy but pushes directly to my github? o.O That seems un-intuitive.
@HaoZeke yeah, we don't (yet) have support for a local filesystem backend.
@Benaiah maybe it should trigger a git pull as well after saving then?
Also I dunno if I ought to ask here but, does anyone know if the netlify CI respects [SKIP CI] or any such commit imperative?
@HaoZeke I don't believe that's supported based on the docs, but you can go to netlify.com and talk to support on the intercom. Great folks on that.
@HaoZeke were you able to fix the "API_ERROR: Reference does not exist"? I think I'm having the same error. Thanks
@nicholasjhs Feel free to reach out on our Gitter channel, with a link to your config.
@josephearl Dude I had this issue for 2 days and was staring it in the eyes lol :)
Thanks Mahn
Most helpful comment
I think I see the issue, you have
media_folderindented underbackend, but it should not be.Can you try this config?: