-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
YAMLException when defining an optional object with optional image fields #253
Comments
@MadsMadsDk thanks for the detailed report! |
I'm also having the same issue. At first I thought it was some weird formatting issue with the image file I was using but I created a basic post only filling the fields that have the 'required' validation enabled. - If the current behavior is a bug, please provide the steps to reproduce. Same steps as above but with my particular setup.
- What is the expected behavior? A markdown file should be generated that looks like so:
- Please mention your node.js, and operating system version. |
Looking into this now. Here's a minimal reproduction case:
- {label: "Test Date", name: "date", widget: "datetime"}
Output:
Looks like we're passing the raw Moment object instead of a timestamp. |
@MadsMadsDk noticing that your case doesn't seem to use a date or datetime widget outside of meta - are you still experiencing this? Can you narrow down to a minimal repro case? |
@josephearl this is a regression from #348 - prior to that, we were using custom schemas, one of which handled parsing moment objects for date/datetime fields. It's not clear how to add custom parsers/schemas for stringifying. The schemas can be found here: https://github.com/netlify/netlify-cms/blob/b64dfab42e4da2bd1ea5255b6d22f4680b6a4e6c/src/formats/yaml.js. Can you take a look? |
Turns out original issue probably is image related, as the error generated in all cases boils down to YAML parser schemas, and we have a custom schema for images in the file linked in my previous comment. The issue that @jaredwolff mentioned is still a regression from #348. |
@erquhart yep will look into it |
@MadsMadsDk this should be resolved now, please re-open if not. |
- Do you want to request a feature or report a bug?
Bug
- What is the current behavior?
NetlifyCMS throws a YAMLException: "unacceptable kind of an object to dump [object Undefined]. I suspect it is caused by defining an object, that contains a bunch of optional images (a relevant usecase would be, like in this case, to implement a responsive image strategy), and not referencing any images as they are optional.
- If the current behavior is a bug, please provide the steps to reproduce.
- What is the expected behavior?
That NetlifyCMS produces a markdown file that looks like this:
- Please mention your node.js, and operating system version.
Node v7.2.0
OS: macOS Sierra 10.12.3
Also using Netlify-git-api, and using the Netlify version shipped via CDN.
The text was updated successfully, but these errors were encountered: