Skip to content

fix: guard openInEditor when inspector is unavailable#1098

Open
Akur1a wants to merge 1 commit into
vuejs:mainfrom
Akur1a:fix/open-in-editor-options-api
Open

fix: guard openInEditor when inspector is unavailable#1098
Akur1a wants to merge 1 commit into
vuejs:mainfrom
Akur1a:fix/open-in-editor-options-api

Conversation

@Akur1a
Copy link
Copy Markdown

@Akur1a Akur1a commented May 12, 2026

Description

This adds a small guard around the Vite plugin open-in-editor path so DevTools does not throw when the component inspector has not been initialized.

In that state __VUE_INSPECTOR__ is unavailable, so calling openInEditor directly raises a TypeError. With this change, DevTools skips the call and logs a clearer warning instead.

Refs #824

@netlify
Copy link
Copy Markdown

netlify Bot commented May 12, 2026

Deploy Preview for vue-devtools-docs canceled.

Name Link
🔨 Latest commit aac3432
🔍 Latest deploy log https://app.netlify.com/projects/vue-devtools-docs/deploys/6a0ac15f3f7261000850a39c

@Akur1a Akur1a force-pushed the fix/open-in-editor-options-api branch from 6af80b4 to 111f768 Compare May 12, 2026 01:09
When the component inspector is not initialized, calling openInEditor through the Vite plugin path throws because __VUE_INSPECTOR__ is missing.

Guard the call and log a clear warning instead, so DevTools does not crash in this state.

Refs vuejs#824
@Akur1a Akur1a force-pushed the fix/open-in-editor-options-api branch from 111f768 to aac3432 Compare May 18, 2026 07:35
@Akur1a Akur1a changed the title fix: check for __VUE_INSPECTOR__ before calling openInEditor fix: guard openInEditor when inspector is unavailable May 18, 2026
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