decap-cms
decap-cms copied to clipboard
TypeError: e.replace is not a function
Describe the bug
Trying to access a specific page when the corresponding data didn't match what was described in config.yml lead to a bug, with an invitation to open an issue here :)
To Reproduce
That was the config:
https://github.com/mawi-website/mawi-website/blob/1b94cc371bfcea1d2c974ba7fc5eec08ea310acd/content/admin/config.yml#L102-L130
That was the data:
https://github.com/mawi-website/mawi-website/blob/1b94cc371bfcea1d2c974ba7fc5eec08ea310acd/content/_gallery.yml
Problem was solved when I fixed the config (https://github.com/mawi-website/mawi-website/commit/815d50356109e2df8315719f7f0ce6966c0f8e38) but it shouldn't have completely crashed.
Expected behavior
It's normal that the cms was unable tu understand the data as it was not the proper format. But it shouldn't have crashed.
Screenshots
Hm sorry, I didn't take a screenshot, but the repo is open source. I got a full page crash.
Applicable Versions:
- Netlify CMS version:
[email protected] - Git provider:
github - Browser version:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:100.0) Gecko/20100101 Firefox/100.0
**CMS configuration** (click to open)
backend:
name: github
repo: mawi-website/mawi-website
branch: main
i18n:
&a1
structure: single_file
locales:
- fr
- en
default_locale: fr
publish_mode: editorial_workflow
media_folder: content/img
public_folder: /img
site_url: https://www.manon-bc.fr
collections:
- name: section
i18n: *a1
label: Sections
files:
- label: À propos de Manon
name: about_me
i18n: *a1
file: content/_about_me.yml
fields:
- label: Titre
name: title
i18n: translate
widget: string
- label: Titre dans la barre de navigation
name: menu_title
i18n: translate
widget: string
- label: Fragment d'URL
hint: Le truc qui apparait dans l'url quand on suit un lien interne qui scrolle
name: fragment
i18n: translate
widget: string
- label: Corps
name: body
i18n: translate
widget: markdown
- label: Images sur le côté
name: images
i18n: none
widget: list
field:
name: src
label: Image
widget: image
i18n: none
- label: Gallerie d'images en dessous
name: gallery
i18n: none
widget: list
fields:
- name: src
label: Image
widget: image
i18n: none
- name: size
label: Image
widget: select
options:
- small
- big
i18n: none
- label: Contact
name: contact
i18n: *a1
file: content/_contact.yml
fields:
- label: Titre
name: title
i18n: translate
widget: string
- label: Titre dans la barre de navigation
name: menu_title
i18n: translate
widget: string
- label: Fragment d'URL
hint: Le truc qui apparait dans l'url quand on suit un lien interne qui scrolle
name: fragment
i18n: translate
widget: string
- label: Corps
name: body
i18n: translate
widget: markdown
- label: Email de contact
name: email
i18n: none
widget: string
- label: Images sur le côté
name: images
i18n: none
widget: list
field:
name: src
label: Image
widget: image
i18n: none
- label: Photos
name: gallery
i18n: *a1
file: content/_gallery.yml
fields:
- label: Titre
name: title
i18n: translate
widget: string
- label: Titre dans la barre de navigation
name: menu_title
i18n: translate
widget: string
- label: Fragment d'URL
hint: Le truc qui apparait dans l'url quand on suit un lien interne qui scrolle
name: fragment
i18n: translate
widget: string
- label: Gallerie d'images en dessous
name: gallery
i18n: none
widget: list
fields:
- name: src
label: Image
widget: image
i18n: none
- name: size
label: Image
widget: select
options:
- small
...