Issue: Data file is not created if it does not exist #491

Closed
opened 2026-10-05 02:49:58 +02:00 by adam · 1 comment
Owner

Describe the bug
With a new data file configuration there is no error message when I add a new item, but the data file is also not created if it does not exists. The config in .frontmatter/config/data/files/kurzschnitte.json is as follows:

{
  "$schema": "https://frontmatter.codes/config/data.files.schema.json",
	"id": "kurzschnitte",
	"title": "Kurzschnitte",
	"file": "[[workspace]]/data/dnb/kollitsch/kurzschnitte.json",
	"fileType": "json",
	"labelField": "title",
	"singleEntry": false,
	"schema": {
		"title": "Kurzschnitte",
		"type": "object",
		"required": [
			"title",
			"link",
			"slug"
		],
		"properties": {
			"title": {
				"type": "string",
				"title": "Title"
			},
			"link": {
				"type": "string",
				"title": "Link"
			},
			"description": {
				"type": "string",
				"multiline": true,
				"title": "Description"
			},
			"labels": {
				"type": "array",
				"items": {
					"type": "string"
				}
			},
			"slug": {
				"type": "string",
				"title": "Kurzschnitt-Post"
			},
		}
	}
}

Adding a new entry on the Dashboard > Data screen -

  1. If the file [[workspace]]/data/dnb/kollitsch/kurzschnitte.json does not exist then Frontmatter shows a success message but does not add the item in the items column, and also no data file in the configured location

  2. If I create a file in [[workspace]]/data/dnb/kollitsch/kurzschnitte.json with an empty JSON content ({}) then it works as expected.

I would expect Frontmatter to have enough rights to create the file (file rights on the folder are checked and belong to the user opening VSCode) or at least fail or convey the failing properly.

Desktop (please complete the following information):

  • OS: Ubuntu 22.04 LTS
  • Browser: Chrome latest
**Describe the bug** With a new data file configuration there is no error message when I add a new item, but the data file is also not created if it does not exists. The config in `.frontmatter/config/data/files/kurzschnitte.json` is as follows: ```json { "$schema": "https://frontmatter.codes/config/data.files.schema.json", "id": "kurzschnitte", "title": "Kurzschnitte", "file": "[[workspace]]/data/dnb/kollitsch/kurzschnitte.json", "fileType": "json", "labelField": "title", "singleEntry": false, "schema": { "title": "Kurzschnitte", "type": "object", "required": [ "title", "link", "slug" ], "properties": { "title": { "type": "string", "title": "Title" }, "link": { "type": "string", "title": "Link" }, "description": { "type": "string", "multiline": true, "title": "Description" }, "labels": { "type": "array", "items": { "type": "string" } }, "slug": { "type": "string", "title": "Kurzschnitt-Post" }, } } } ``` Adding a new entry on the Dashboard > Data screen - 1) If the file `[[workspace]]/data/dnb/kollitsch/kurzschnitte.json` does not exist then Frontmatter shows a success message but does not add the item in the items column, and also no data file in the configured location 2) If I create a file in `[[workspace]]/data/dnb/kollitsch/kurzschnitte.json` with an empty JSON content (`{}`) then it works as expected. I would expect Frontmatter to have enough rights to create the file (file rights on the folder are checked and belong to the user opening VSCode) or at least fail or convey the failing properly. **Desktop (please complete the following information):** - OS: Ubuntu 22.04 LTS - Browser: Chrome latest <!-- github-sync-id:1849734218 -->
adam closed this issue 2026-10-05 02:49:58 +02:00
Author
Owner

Thanks @davidsneighbour; this has been fixed in the latest beta.

Thanks @davidsneighbour; this has been fixed in the latest beta. <!-- github-comment-id:1685232932 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/vscode-front-matter#491