Skip to content

fix: open editor without inspector global - #1113

Open
pupuking723 wants to merge 1 commit into
vuejs:mainfrom
pupuking723:fix/open-editor-without-inspector-global
Open

fix: open editor without inspector global#1113
pupuking723 wants to merge 1 commit into
vuejs:mainfrom
pupuking723:fix/open-editor-without-inspector-global

Conversation

@pupuking723

Copy link
Copy Markdown

Fixes #824.

When the Vite plugin is detected, openInEditor() currently assumes window.__VUE_INSPECTOR__ has been registered. If the inspector runtime does not register that global, the "Open in Editor" action throws before it can reach the Vite open-in-editor middleware.

This keeps the existing inspector path when the global is available, and falls back to the same __open-in-editor?file=... request shape used by vite-plugin-vue-inspector when the global is missing.

Verification:

  • pnpm exec vitest run packages/devtools-kit/__tests__/core/open-in-editor.test.ts --config /private/tmp/vue-devtools-vitest.config.ts
  • pnpm exec eslint packages/devtools-kit/src/core/open-in-editor/index.ts packages/devtools-kit/__tests__/core/open-in-editor.test.ts
  • pnpm build:devtools-kit
  • git diff --check

I also tried pnpm type-check, but this checkout currently fails before reaching these files because packages/core/src/rpc/global.ts and packages/core/src/rpc/vite.ts cannot resolve hookable.

@netlify

netlify Bot commented Jul 21, 2026

Copy link
Copy Markdown

Deploy Preview for vue-devtools-docs canceled.

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

@pupuking723
pupuking723 marked this pull request as ready for review July 28, 2026 02:16
@pupuking723

Copy link
Copy Markdown
Author

I noticed #1098 covers the same missing-inspector case. The difference is that #1098 guards the call and warns, while this PR falls back to the Vite __open-in-editor endpoint and includes coverage for that path. I am happy to close this one or move the fallback and tests onto #1098 if that is easier to review.

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.

Open in Editor dosent work when Options API disabled

1 participant