When trying to create a Collection type that implements the List widget I get the error Cannot read property 'slice' of undefined.
This gets logged into the console.
Editor.js:224 Uncaught (in promise)
{type: "UNPUBLISHED_ENTRY_PERSIST_FAILURE", payload: {鈥, optimist: {鈥, error: TypeError: Cannot read property 'slice' of undefined at a (https://unpkg.com/[email protected]/d鈥
error: TypeError: Cannot read property 'slice' of undefined at a (https://unpkg.com/[email protected]/dist/netlify-cms.js:101:95865)
type: "UNPUBLISHED_ENTRY_PERSIST_FAILURE"
I am using
I am not using Netlify-Cms as an npm package.
To Reproduce
Expected behavior
A new page of type General Detail to save.
Screenshots

Applicable Versions:
CMS configuration
backend:
name: git-gateway
branch: master
publish_mode: editorial_workflow
media_folder: static/img
public_folder: /img
collections:
- label: "Blog"
name: "blog"
folder: "src/ui/folders/posts"
create: true
fields:
- {label: "Layout", name: "layout", widget: "hidden", default: "blog"}
- {label: "Title", name: "title", widget: "string"}
- {label: "Description", name: "description", widget: "string"}
- {label: "Publish Date", name: "date", widget: "datetime"}
- {label: "Featured Image", name: "image", widget: "image"}
- {label: "Body", name: "body", widget: "markdown"}
- label: "General Detail Page"
name: "generaldetail"
folder: "src/ui/folders/pages"
create: true
fields:
- {label: "Title", name: "title", widget: "string"}
- {label: "Layout", name: "layout", widget: "hidden", default: "generaldetail"}
- {label: "Description", name: "description", widget: "string"}
- label: "Main Body"
name: "body"
widget: "list"
fields:
- label: "Carousel"
name: "carousel"
widget: object
fields:
- {label: Header, name: header, widget: string, default: "Image Gallery"}
- {label: Template, name: template, widget: string, default: "carousel.html"}
- label: "Pages"
name: "pages"
files:
- label: "Home Page"
name: "home"
file: "src/ui/files/homepage.md"
fields:
- {label: "Layout", name: "layout", widget: "hidden", default: "homepage"}
- label: "Header Section"
name: "header"
widget: "object"
fields:
- label: "Navigation"
name: "navigation"
widget: "list"
fields:
- {label: "Text", name: "linkText", widget: string}
- {label: "Link", name: "link", widget: string}
- {label: Logo, name: logo, widget: image}
- {label: "Title", name: "title", widget: "string"}
- label: "Introduction Section"
name: "intro"
widget: "object"
fields:
- {label: "Tab Name", name: "introTabName", widget: "string"}
- {label: "Title", name: "introTitle", widget: "string"}
- {label: "Large Text", name: introLargeText, widget: string}
- {label: "Description", name: "introDescription", widget: "markdown"}
- label: "Button"
name: "introButton"
widget: "object"
fields:
- {label: "Text", name: "introButtonText", widget: string}
- {label: "Link", name: "introButtonLink", widget: string}
Additional context
Repo: https://github.com/meinvolk/gatsby-velocity
I believe name: "body" is reserved for markdown content. Try changing the name of the list widget.
@meinvolk Here is the issue
- label: "Main Body"
name: "body"
widget: "list"
fields:
- label: "Carousel"
name: "carousel"
widget: object
fields:
- {label: Header, name: header, widget: string, default: "Image Gallery"}
- {label: Template, name: template, widget: string, default: "carousel.html"}
Any widget named body is used as the content of the frontmatter and should return a simple string. So widget like list and object that returns nested values won't work. I suggest you either rename the above widget or use a widget like markdown.
@tomrutgers closing this?
Yes, sorry I am at work and have not been able to test this. I am fairly certain this is going to fix it though. Thanks guys!
Most helpful comment
I believe
name: "body"is reserved for markdown content. Try changing the name of the list widget.