Error when loading admin page of netlify cms

Error when loading the admin page on the Netlify CMS.

config must have required property ‘media_folder’
config must have required property ‘media_library’
config must match a schema in anyOf

I have media_folder and I thought that media_library isn’t a required field, or am I wrong.

my config.yml file looks like this

  name: git-gateway
  branch: main

media_folder: "public/images"
public_folder: "/images"

  - name: "event"
    label: "Event"
    folder: "src/event"
    create: true
    slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
      - { label: "Event Title", name: "title", widget: "string" }
      - { label: "Event Type", name: "type", widget: "string" }
      - { label: "Event Description", name: "description", widget: "markdown" }
      - { label: "Event Date", name: "date", widget: "datetime" }

Any help is appreciated.

Hello @Apollos26, thanks for posting and welcome.
Looks like you don’t have media_library in your configuration.
The config should look similar to the code below

media_folder: "public/images/uploads"
   name: uploads

The above code depends on your static site generator.
What static site generator are using though?

Thanks for the response. I’m using 11ty as the static site generator.

Hi @Apollos26, thanks for the feedback.
Make sure your config.yml file is in the admin folder in your project root.

My root does contain the admin folder with the yml file. Any other suggestions?

Hi @Apollos26, kindly use the website below to validate your config.yml file contents for possible indentation errors e.t.c.

In addition if possible can you share the repository of your site?

Yes here is the link to the repository Also I ran the config file through the validator and it said that it is valid yaml.

Hi @Apollos26, thanks for sharing the repository.
Since you are using 11ty, kindly move the admin folder containing both index.html and config.yml to the src directory and then redeploy again to see if it works.

└── src/
    └── admin/
        ├── index.html
        └── config.yml

Let me know the outcome.

It worked! Thanks for your help.


Great debugging, @clarnx! Thanks for much for the info!

1 Like