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

Failed to load config.yml error message when first logging on to deployed site #6862

Open
ItsEthanH opened this issue Jul 29, 2023 · 7 comments
Labels
type: bug code to address defects in shipped code

Comments

@ItsEthanH
Copy link

ItsEthanH commented Jul 29, 2023

Describe the bug
When deploying a project using DecapCMS, the first time you go to /admin/, an error message shows reading:

Error loading the CMS configuration
Config Errors:

Error: Failed to load config.yml (404)

Check your config.yml file.

It seems as if this is because the URL isn't formatted correctly. Going to /admin/ redirects me to:

https://www.domain.com/admin#/

When instead I should go to

https://www.domain.com/admin/#/

To Reproduce

  1. Go to a project using Decap, without having logged in before (clearing cookies may help with this)
  2. Navigate to the /admin/ route
  3. Note the above error message, with the document URL path reading /admin#/
  4. Change the path to /admin/#/
  5. Note that this now works

Expected behavior
For a user to immediately go to /admin/#/

Screenshots

Broken path and error:
image

Applicable Versions:

  • Netlify CMS version: ^2.0.0
  • Git provider: Github
  • OS: Windows 10
  • Browser version Firefox 115.0.3 64bit
  • Node.JS version: v20.3.1

CMS configuration
May not be relevant, as it's been replicated with a range of CMS configurations, however:

backend:
name: git-gateway
branch: main

local_backend: true
logo_url: https://codestitch.app/frontend/images/logo.png

media_folder: "public/assets/images/blog"
public_folder: "/assets/images/blog"

collections:
- name: "blog"
label: "Blog"
folder: "src/content/blog"
create: true
slug: "{{slug}}"
fields:
- { label: "Title", name: "title", widget: "string" }
- { label: "Description", name: "description", widget: "string" }
- { label: "Author", name: "author", widget: "string" }
- { label: "Date", name: "date", widget: "datetime" }
- { label: "Tags", name: "tags", widget: "list", default: ["post"] }
- { label: "Featured Image", name: "image", widget: "image" }
- { label: "Image Caption", name: "imageAlt", widget: "string" }
- { label: "Body", name: "body", widget: "markdown" }

@ItsEthanH ItsEthanH added the type: bug code to address defects in shipped code label Jul 29, 2023
@martinjagodic
Copy link
Member

@ItsEthanH which SSG are you using?

@ItsEthanH
Copy link
Author

Heya, it's eleventy :)

@martinjagodic
Copy link
Member

I observed the same bug with the Hugo template: decaporg/one-click-hugo-cms#781

@fdb
Copy link

fdb commented Aug 25, 2023

I had the same issue. It seems Decap is trying to load the config from the root path (/config.yml) instead of the admin path (/admin/config.yml).

@soonium
Copy link

soonium commented Sep 22, 2023

I have the same issue also with 11ty.

@sukaikan
Copy link

Hi everyone, I am today trying to use that CMS, and showing the same problem. It showed me a 404 config.yml not found. Has anyone solved the problem? Thanks

@tonyd256
Copy link

tonyd256 commented Feb 1, 2024

Not sure if it's helpful, but I use Eleventy and had to manually pass through the config file in the build settings. For eleventy it was adding config.addPassthroughCopy({ "admin/config.yml": "admin/config.yml" }); to my .eleventy.js config file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug code to address defects in shipped code
Projects
None yet
Development

No branches or pull requests

6 participants