Empty or null tags break the Command Palette #14

Closed
opened 2026-10-05 02:22:09 +02:00 by adam · 2 comments
Owner

Using the Insert Tag dialog when there is an empty tag value in the YAML tag array it is replaced with null. i.e.

tag:
  -

is rewritten to:

tag:
  - null

The null value then causes an error that breaks the command palette. The command palette still opens, and I can navigate up and down, but I can't activate any options. The only way I've found to restore it is to close VSCode and reopen. ("Reload Window" also works, but I've removed the keyboard shortcut so can't activate it without command palette.)

I believe this is related to #7 because the list of tags no longer displays if I open the Insert Tag dialog. Here is the console output when the error is triggered:

ERR Cannot read property 'toString' of null: TypeError: Cannot read property 'toString' of null
at file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:558:254
at Array.map (<anonymous>)
at E.splice (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:558:207)
at file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:34:64
at Array.forEach (<anonymous>)
at t.CombinedSpliceable.splice (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:34:51)
at file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:578:688
at t.EventBufferer.bufferEvents (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:101:214)
at M.splice (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:578:655)
at I.setElements (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1193:909)
at E.update (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1211:761)
at E.set items [as items] (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1204:518)
at file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1222:517
Using the Insert Tag dialog when there is an empty tag value in the YAML tag array it is replaced with `null`. i.e. ``` tag: - ``` is rewritten to: ``` tag: - null ``` The `null` value then causes an error that breaks the command palette. The command palette still opens, and I can navigate up and down, but I can't activate any options. The only way I've found to restore it is to close VSCode and reopen. ("Reload Window" also works, but I've removed the keyboard shortcut so can't activate it without command palette.) I believe this is related to #7 because the list of tags no longer displays if I open the Insert Tag dialog. Here is the console output when the error is triggered: ``` ERR Cannot read property 'toString' of null: TypeError: Cannot read property 'toString' of null at file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:558:254 at Array.map (<anonymous>) at E.splice (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:558:207) at file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:34:64 at Array.forEach (<anonymous>) at t.CombinedSpliceable.splice (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:34:51) at file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:578:688 at t.EventBufferer.bufferEvents (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:101:214) at M.splice (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:578:655) at I.setElements (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1193:909) at E.update (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1211:761) at E.set items [as items] (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1204:518) at file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1222:517 ``` <!-- github-sync-id:725011550 -->
adam closed this issue 2026-10-05 02:22:09 +02:00
Author
Owner

Thanks for reporting this!

Thanks for reporting this! <!-- github-comment-id:719365785 -->
Author
Owner

I just release version 1.7.2 which should fix this issue. Feel free to verify this on your environment.

I just release version `1.7.2` which should fix this issue. Feel free to verify this on your environment. <!-- github-comment-id:719424926 -->
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#14