MarshallOfSound / MarshallOfSound/electron-devtools-installer
electron 30.5.1 electron-devtools-installer 4.0.0 。install success but devtools not show vue tab
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.2k
- Forks
- 151
- PR merge metrics
- No merged PRs in 30d
Description
electron 30.5.1 electron-devtools-installer 4.0.0 。install success but devtools not show vue tab。 My main.ts
`import { app, BrowserWindow, session, globalShortcut } from "electron";
import installExtension, { VUEJS_DEVTOOLS } from "electron-devtools-installer";
// import { createRequire } from "node:module";
import { fileURLToPath } from "node:url";
import path from "node:path";
app.setName("ONEAI");
// const require = createRequire(import.meta.url);
const __dirname = path.dirname(fileURLToPath(import.meta.url));
// The built directory structure
//
// ├─┬─┬ dist
// │ │ └── index.html
// │ │
// │ ├─┬ dist-electron
// │ │ ├── main.js
// │ │ └── preload.mjs
// │
process.env.APP_ROOT = path.join(__dirname, "..");
// 🚧 Use ['ENV_NAME'] avoid vite:define plugin - Vite@2.x
export const VITE_DEV_SERVER_URL = process.env["VITE_DEV_SERVER_URL"];
export const MAIN_DIST = path.join(process.env.APP_ROOT, "dist-electron");
export const RENDERER_DIST = path.join(process.env.APP_ROOT, "dist");
process.env.VITE_PUBLIC = VITE_DEV_SERVER_URL
? path.join(process.env.APP_ROOT, "public")
: RENDERER_DIST;
let win: BrowserWindow | null;
async function createWindow() {
win = new BrowserWindow({
icon: path.join(process.env.VITE_PUBLIC, "electron-vite.svg"),
width: 1400,
height: 900,
webPreferences: {
preload: path.join(__dirname, "preload.mjs"),
webviewTag: true,
},
});
// Test active push message to Renderer-process.
win.webContents.on("did-finish-load", () => {
win?.webContents.send("main-process-message", new Date().toLocaleString());
// 在页面加载完成后打开 DevTools(仅开发环境)
if (VITE_DEV_SERVER_URL) {
// 使用 'right' 模式将 DevTools 停靠在右侧,更方便查看
win?.webContents.openDevTools({ mode: "right" });
console.log("✅ DevTools opened in right mode");
}
});
if (VITE_DEV_SERVER_URL) {
win.loadURL(VITE_DEV_SERVER_URL);
} else {
// win.loadFile('dist/index.html')
// win.loadFile(path.join(RENDERER_DIST, "index.html"));
win.loadURL("http://localhost:5173/index.html");
}
globalShortcut.register("Ctrl+Shift+I", () => {
win?.webContents.toggleDevTools();
});
// macOS 快捷键
globalShortcut.register("Command+Option+I", () => {
win?.webContents.toggleDevTools();
});
}
// Quit when all windows are closed, except on macOS. There, it's common
// for applications and their menu bar to stay active until the user quits
// explicitly with Cmd + Q.
app.on("window-all-closed", () => {
if (process.platform !== "darwin") {
app.quit();
win = null;
}
});
app.on("activate", () => {
if (BrowserWindow.getAllWindows().length === 0) {
createWindow();
}
});
app.whenReady().then(async () => {
if (VITE_DEV_SERVER_URL) {
try {
console.log("🔧 Installing Vue DevTools for Vue 3...");
const name = await installExtension(VUEJS_DEVTOOLS, {
loadExtensionOptions: {
allowFileAccess: true,
},
});
console.log(`✅ Vue DevTools installed: ${name}`);
} catch (err) {
console.error("❌ Vue DevTools installation failed:", err);
}
}
console.log("🚀 Application started");
createWindow();
// 在窗口创建后安装 Vue DevTools
});
`
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reported electron 30.5.1 and electron-devtools-installer 4.0.0 setup in main.ts, especially the app.whenReady() installation and createWindow() flow. Reproduce the development launch, inspect the installation log and DevTools extension state, and determine why the Vue tab is absent despite successful installation. Done means the Vue tab appears in the opened DevTools for the provided setup, with a documented verification path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- electron, typescript
- Domain
- desktop, devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100