-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Devtool won't show in 0.29.0 version #264
Comments
yeah, same here, any fix? |
you need to wait for window to open before opening devtools if you are using async/await do something like this await mainWindow.loadURL(devServerUrl)
mainWindow.webContents.openDevTools() if not mainWindow.loadURL(devServerUrl).then(() => mainWindow.webContents.openDevTools()) |
Still won't work, even try to open the devtool from menu. |
I'm having this issue on Linux, but my co-workers who use macOS are unaffected. |
I see this problem too. Bisection shows it was introduced by commit 638d0f3, specifically this part of the change: --- a/src/index.ts
+++ b/src/index.ts
@@ -165,7 +168,10 @@ export async function startup(
await startup.exit()
// Start Electron.app
- process.electronApp = spawn(electronPath, argv, { stdio: 'inherit', ...options })
+ process.electronApp = spawn(electronPath, argv, {
+ stdio: ['inherit', 'inherit', 'inherit', 'ipc'],
+ ...options,
+ })
// Exit command after Electron.app exits
process.electronApp.once('exit', process.exit) |
Minimal reproduction on Linux from an empty directory:
import { app, BrowserWindow } from "electron";
app.whenReady().then(async () => {
const win = new BrowserWindow();
await win.loadURL("about:blank");
win.webContents.openDevTools();
});
{
"main": "dist-electron/main.js",
"dependencies": {
"electron": "^34.3.0",
"vite": "^5.4.14",
"vite-plugin-electron": "^0.29.0"
}
}
import electron from "vite-plugin-electron/simple";
export default {
plugins: [
electron({
main: {
entry: "electron/main.js",
},
}),
],
}; Run |
In latest version 0.29.0, the devtool won't open, but 0.28.* versions works.
Tested using this template:
https://github.com/electron-vite/electron-vite-vue
The text was updated successfully, but these errors were encountered: