- Do you want to request a feature or report a bug?
Bug
- Please mention your versions where applicable.
Netlify CMS version: 1.7.0
Browser version: Latest Chrome Canary (ran in Chrome OS)
- Please link or paste your config.yml below if applicable.
-> https://github.com/Kakise/Blog/tree/master/source/admin
Looks like the main error in the log is:
react-dom.production.min.js:163 TypeError: e.get is not a function
at t.value (ListControl.js:204)
at renderItem (ListControl.js:245)
at immutable.js:3016
at immutable.js:1377
at ue.iterate.de.iterate (immutable.js:1726)
at le.__iterate (immutable.js:1375)
at n.Qe.r.__iterateUncached (immutable.js:3015)
at z (immutable.js:604)
at n.x.__iterate (immutable.js:274)
at n.forEach (immutable.js:4381)
@Kakise The "Tags" field under your config is set to widget type list, but doesn't have any sub-fields specified. I'm guessing this is the problem here.
That was the problem. I had to change from list to object. It is now working, thanks.
I am having a similar issue with my "Introduction" file collection. Here is the config:
backend:
name: github
repo: caseykey/caseykey.github.io
branch: source
site_domain: quirky-bassi-7f760a.netlify.com
site_url: https://caseyjkey.com
display_url: https://caseyjkey.com
public_folder: "/src/images/"
media_folder: "/src/images/"
collections:
- label: "Sections"
name: "sections"
files:
- label: "Introduction"
name: "introduction"
file: "src/data/introduction.json"
fields:
- {label: "Greeting", name: "greeting", widget: "string", default: "Hey! I am"}
- {label: "Name", name: "name", widget: "string", default: "Casey Key"}
- label: "Descriptions"
label_singular: "description"
name: "descriptions"
widget: "list"
field:
- label: "Description"
name: "description"
widget: "object"
fields:
- {label: "Description", name: "header", widget: "string"}
- {label: "Example", name: "subheader", widget: "string"}
This shows me a list of "No undefined". When this "No undefined" is opened, it is a string entry that is labeled, "undefined". I want a list of objects, each labeled "Description" with two string fields.
Why am I only seeing one "undefined" string field for each object, and why is each object "No undefined"? When I try to submit an entry, I get the original error of e.get is not a function.
The field property takes an object, not a list: https://www.netlifycms.org/docs/widgets/#list
collections:
- label: "Sections"
name: "sections"
files:
- label: "Introduction"
name: "introduction"
file: "src/data/introduction.json"
fields:
- {label: "Greeting", name: "greeting", widget: "string", default: "Hey! I am"}
- {label: "Name", name: "name", widget: "string", default: "Casey Key"}
- label: "Descriptions"
label_singular: "description"
name: "descriptions"
widget: "list"
field: {
label: "Description",
name: "description",
widget: "object",
fields:
- {label: "Description", name: "header", widget: "string"}
- {label: "Example", name: "subheader", widget: "string"}
}
@tomrutgers
I am getting this error now:
YAMLException: missed comma between flow collection entries at line 32, column 15:
- {label: "Description", name: " ...
It expects a comma instead of the -.
I tried this:
- {label: "Greeting", name: "greeting", widget: "string", default: "Hey! I am"}
- {label: "Name", name: "name", widget: "string", default: "Casey Key"}
- label: "Descriptions"
label_singular: "description"
name: "descriptions"
widget: "list"
field: {
label: "Description",
name: "description",
widget: "object",
field: {
{label: "Description", name: "header", widget: "string"},
{label: "Example", name: "subheader", widget: "string"}
}
}
Which results in this error:
YAMLException: duplicated mapping key at line 34, column 15:
}
Not sure what to do as objects require a nested list of fields
EDIT: Fixed it using https://yaml-online-parser.appspot.com/
Most helpful comment
@Kakise The "Tags" field under your config is set to widget type
list, but doesn't have any sub-fields specified. I'm guessing this is the problem here.