The UI for adding Tags is displayed correctly, and adding tags through it results in something like this:
tags:- label:Sveltecolor:primaryfieldGroup:tag
However, when after saving the file, the Dashboard immediately crashes. On developer tools, I was able to get the error message:
Objects are not valid as a React child (found: object with keys {label, color, fieldGroup}). If you meant to render a collection of children, use an array instead.
Removing the tags field or leaving it empty ([]) makes the dashboard open again.
The content with the tags is in the cms/work-experiences folder
Expected behavior
I expect the dashboard to open
Desktop (please complete the following information):
OS: macOS Sonoma 14.0
**Describe the bug**
I've started using fieldGroups in my Frontmatter config to add a "tag" object, defined in frontmatter.json like this:
```json
"frontMatter.taxonomy.fieldGroups": [
{
"id": "tag",
"labelField": "label",
"fields": [
{
"title": "Label",
"name": "label",
"type": "string",
"single": true
},
{
"title": "Color",
"name": "color",
"type": "choice",
"choices": ["primary", "secondary"]
}
]
}
]
```
This is used in a content type called "Work Experience", and the Tags prop is defined like this:
```json
"frontMatter.taxonomy.contentTypes": [
{
"name": "Work Experience",
"fields": [
{
"title": "Tags",
"name": "tags",
"type": "block",
"fieldGroup": ["tag"]
}
]
},
```
The UI for adding Tags is displayed correctly, and adding tags through it results in something like this:
```yaml
tags:
- label: Svelte
color: primary
fieldGroup: tag
```
However, when after saving the file, the Dashboard immediately crashes. On developer tools, I was able to get the error message:
> Objects are not valid as a React child (found: object with keys {label, color, fieldGroup}). If you meant to render a collection of children, use an array instead.
Removing the tags field or leaving it empty (`[]`) makes the dashboard open again.
**To Reproduce**
Steps to reproduce the behavior:
1. [Clone this repo](https://github.com/matfantinel/fantinel.dev/tree/cmsify) (make sure to use the cmsify branch)
2. Open the Frontmatter Dashboard
3. The content with the tags is in the cms/work-experiences folder
**Expected behavior**
I expect the dashboard to open
**Desktop (please complete the following information):**
- OS: macOS Sonoma 14.0
<!-- github-sync-id:1920055320 -->
Huh, the issue seems to be with the tags/tag name. Just changing the name of the field fixed it. Probably tags is hardcoded in a few places to make the default tags work?
In any case, my issue is solved!
Huh, the issue seems to be with the `tags/tag` name. Just changing the name of the field fixed it. Probably tags is hardcoded in a few places to make the default tags work?
In any case, my issue is solved!
<!-- github-comment-id:1741623874 -->
Thank you @matfantinel for opening and letting me know the solution. tags and categories are indeed two field types, which might cause issues, but will have a look if we can make the experience better and not let the CMS crash.
Thank you @matfantinel for opening and letting me know the solution. `tags` and `categories` are indeed two field types, which might cause issues, but will have a look if we can make the experience better and not let the CMS crash.
<!-- github-comment-id:1741712645 -->
@matfantinel I made a change to the code to make sure this cannot happen anymore. It will be testable in the latest beta.
@matfantinel I made a change to the code to make sure this cannot happen anymore. It will be testable in the latest beta.
<!-- github-comment-id:1741724913 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Describe the bug
I've started using fieldGroups in my Frontmatter config to add a "tag" object, defined in frontmatter.json like this:
This is used in a content type called "Work Experience", and the Tags prop is defined like this:
The UI for adding Tags is displayed correctly, and adding tags through it results in something like this:
However, when after saving the file, the Dashboard immediately crashes. On developer tools, I was able to get the error message:
Removing the tags field or leaving it empty (
[]) makes the dashboard open again.To Reproduce
Steps to reproduce the behavior:
Expected behavior
I expect the dashboard to open
Desktop (please complete the following information):
Huh, the issue seems to be with the
tags/tagname. Just changing the name of the field fixed it. Probably tags is hardcoded in a few places to make the default tags work?In any case, my issue is solved!
Thank you @matfantinel for opening and letting me know the solution.
tagsandcategoriesare indeed two field types, which might cause issues, but will have a look if we can make the experience better and not let the CMS crash.@matfantinel I made a change to the code to make sure this cannot happen anymore. It will be testable in the latest beta.