Hello,
I’m new to Netlify cms and just trying to learn through using the docs and the official Gatsby starter: https://github.com/netlify-templates/gatsby-starter-netlify-cms/
I am running into a problem when creating a new file collection. One of the field widgets which holds the ‘templateKey’, is not being processed resulting in errors when trying to build.
- name: "menus"
label: "Menus"
files:
- file: "src/pages/menus/takeaway.md"
label: "Takeaway Menu"
name: "takeaway"
fields:
- {label: "Template Key", name: "templateKey", widget: "hidden", default: "takeaway-menu"}
- {label: Subheading, name: subheading, widget: string}
The full code snippet in question can be found here
All the other fields in this file collection show up perfectly in the cms the problem arises when trying to update the page I get this error:
error Your site’s “gatsby-node.js” created a page with a component that doesn’t exist.
The path to the missing component is “/opt/build/repo/src/templates/null.js”
The page object passed to createPage:
The path for the component template should come from the ‘templateKey’ in config.yml however null is passed since it is not given a value.
The resulting markdown file does have everything else show up in the frontmatter and adding the templateKey in manually does make the errors disappear when building but this needs to be done every time after updating the cms.
I have tested out creating new folder collections with no issues passing through the templateKey however I can’t get it to work with file collections. Any suggestions would be great!