Error loading the CMS configuration with Docusaurus
- Dominant language
- JavaScript
- Stars
- 19.4k
- Forks
- 3.1k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 9
Description
I have the index.html file in `/static/admin`:
```html
Content Manager
```
and the config.yml file in `/static/admin`:
```yaml
backend:
name: github
repo: my-repo
branch: "dev"
publish_mode: editorial_workflow
media_folder: "static/img"
public_folder: "/img/"
collections:
- name: docs
label: "docs"
folder: docs
identifier_field: title
extension: md
widget: "list"
create: true
slug: "{{slug}}"
sortable_fields: ["title"]
fields:
- { label: "Title", name: "title", widget: "string", required: true }
- { label: "Sidebar Label", name: "sidebar_label", widget: "string", required: true }
- { label: "Sidebar Position", name: "sidebar_position", widget: "number", required: true }
- { label: "Author", name: "author", widget: "string", required: true }
- { label: "Body", name: "body", widget: "markdown", required: true }
```
When I build the docusaurus site, and then load `https://my-site/admin` I get the following:
```
Error loading the CMS configuration
Config Errors:
YAMLSyntaxError: All collection items must start at the same column at line 1, column 1:
^^^^^^^^^^^^^^^…
Check your config.yml file.
```
Console:
```
decap-cms-app 3.9.0
decap-cms-core 3.9.0
decap-cms 3.9.0
config.js:353 Response for config.yml was not yaml. (Content-Type: text/html; charset=utf-8)
parse-cst.js:360 Uncaught (in promise) YAMLSyntaxError: All collection items must start at the same column at line 1, column 1:
^^^^^^^^^^^^^^^…
```
I'm at a loss....
Contributor guide
Research direction
Start by inspecting the built `/admin` output and requesting `/admin/config.yml`, comparing the response with the source file in `/static/admin`. Check the Docusaurus static-file handling and the browser's reported content type. Done means `/admin/config.yml` returns the YAML configuration rather than an HTML document and the CMS loads without the parse error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- content, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100