Skip to content

refactor(overlay): fix a type error for rpcServer.functions.on#1076

Open
skirtles-code wants to merge 1 commit intovuejs:mainfrom
skirtles-code:overlay-type-error
Open

refactor(overlay): fix a type error for rpcServer.functions.on#1076
skirtles-code wants to merge 1 commit intovuejs:mainfrom
skirtles-code:overlay-type-error

Conversation

@skirtles-code
Copy link
Copy Markdown
Contributor

The current code is:

const rpcServer = getRpcServer<typeof functions>()
rpcServer.functions.on('toggle-panel', (state = !panelVisible) => {
  togglePanelVisible(undefined, state)
})

TypeScript reports an error for rpcServer.functions.on. The typing for rpcServer.functions comes from the second generic parameter of getRpcServer, which isn't specified in the line above. I believe typeof functions needs to be the second parameter ('local functions'), rather than the first ('remote functions').

I've changed it to getRpcServer<never, typeof functions>(). I used never because we don't use any remote functions in this part of the code.

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 28, 2026

Deploy Preview for vue-devtools-docs canceled.

Name Link
🔨 Latest commit fb5b0f9
🔍 Latest deploy log https://app.netlify.com/projects/vue-devtools-docs/deploys/69c8588c7b71b90008328eb9

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 28, 2026

Open in StackBlitz

@vue/devtools-applet

npm i https://pkg.pr.new/@vue/devtools-applet@1076

@vue/devtools-core

npm i https://pkg.pr.new/@vue/devtools-core@1076

@vue/devtools

npm i https://pkg.pr.new/@vue/devtools@1076

@vue/devtools-api

npm i https://pkg.pr.new/@vue/devtools-api@1076

@vue/devtools-kit

npm i https://pkg.pr.new/@vue/devtools-kit@1076

@vue/devtools-electron

npm i https://pkg.pr.new/@vue/devtools-electron@1076

@vue/devtools-shared

npm i https://pkg.pr.new/@vue/devtools-shared@1076

@vue/devtools-ui

npm i https://pkg.pr.new/@vue/devtools-ui@1076

vite-plugin-vue-devtools

npm i https://pkg.pr.new/vite-plugin-vue-devtools@1076

commit: fb5b0f9

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.

1 participant