Skip to content

fix: guard against undefined commandShortcuts when saving shortcuts#264

Open
arashsheyda wants to merge 1 commit intovitejs:mainfrom
arashsheyda:fix/undefined-commandShortcuts
Open

fix: guard against undefined commandShortcuts when saving shortcuts#264
arashsheyda wants to merge 1 commit intovitejs:mainfrom
arashsheyda:fix/undefined-commandShortcuts

Conversation

@arashsheyda
Copy link
Contributor

Description

Saving a keyboard shortcut would throw Cannot set properties of undefined when commandShortcuts was missing from persisted settings (e.g. settings saved before this field existed).

Linked Issues

closes #263

Additional context

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 25, 2026

Open in StackBlitz

@vitejs/devtools

npm i https://pkg.pr.new/@vitejs/devtools@264

@vitejs/devtools-kit

npm i https://pkg.pr.new/@vitejs/devtools-kit@264

@vitejs/devtools-rolldown

npm i https://pkg.pr.new/@vitejs/devtools-rolldown@264

@vitejs/devtools-rpc

npm i https://pkg.pr.new/@vitejs/devtools-rpc@264

@vitejs/devtools-self-inspect

npm i https://pkg.pr.new/@vitejs/devtools-self-inspect@264

commit: 5784360

@antfu
Copy link
Member

antfu commented Mar 25, 2026

But with mergeInitialValue it should have always be initilized - so if there is something wrong on that, it's better for us to fix that instead, otherwise the similar issue could occur again when we add new values in the the settings

@arashsheyda
Copy link
Contributor Author

oh I didn't realize. I try to put a fresh reproduction, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TypeError: Cannot set properties of undefined when saving keyboard shortcuts

2 participants