How do I install vue-devtools? #906
-
I'm having a difficult time connecting my Electron apps to vue-devtools. Does anyone have a guide? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
vite-electron-builder/packages/main/src/index.ts Lines 43 to 56 in 0ae2c72 |
Beta Was this translation helpful? Give feedback.
-
@cawa-93 I feel like I'm doing exactly what's intended... if (import.meta.env.DEV) {
app.whenReady()
.then(() => import("electron-devtools-installer"))
.then(({default: installExtension, VUEJS3_DEVTOOLS}) => installExtension(VUEJS3_DEVTOOLS, {
loadExtensionOptions: {
allowFileAccess: true,
},
}))
.catch(e => console.error(`Failed install extension: ${e}`));
} I tried adding Executed Error seen in debug console: No Vue tools are seen in the devTools. Any advice would be appreciated. I'd really like to get rolling with your awesome template! I would hope I can use Vue Dev tools along with Pinia state management support. |
Beta Was this translation helpful? Give feedback.
-
Latest version is failing to install dev tools:
Seems like it's the package's probelm, using I'm surprised we don't have a workaround outlined in the code. Do you think adding something like this would be helpful? I found this code on here somewhere: I'm sorry I forgot who wrote it, originally! // This is the workaround for `electron-devtools-installer`
// To get your extension-id:
// 1. In a chrome browser, go to url `chrome://extensions/`
// 2. Select dev tools extension
// 3. Look in address bar.
// 4. Find that folder here:
// `C:\Users\YOUR_NAME_HERE\AppData\Local\Google\Chrome\User Data\Default\Extensions`
// 5. The version's folder name for the path `extensionVersion` seen below.
if (import.meta.env.DEV) {
const { app, session } = require("electron");
const path = require("path");
const os = require("os");
const extensionId = "\\nhdogjmejiglipccpnnnanhbledajbpd";
const basePath = "AppData\\Local\\Google\\Chrome\\User Data\\Default\\Extensions";
const extensionVersion = "\\6.5.0_0";
const vueDevToolsPath = path.join( os.homedir(), basePath, extensionId, extensionVersion );
app.whenReady().then(async () => {
await session.defaultSession.loadExtension(vueDevToolsPath);
})
.catch(e => console.error("Failed to install dev tools:", e));
} |
Beta Was this translation helpful? Give feedback.
vite-electron-builder/packages/main/src/index.ts
Lines 43 to 56 in 0ae2c72