vue-cli-plugin-electron-builder: Vue JS Dev Tools - Not detecting VUE DOM
Vue JS Dev Tools - installing but does not list elements When running yarn electron:serve - the VUE JS dev tools are not registering any elements as VUE. However the tools are installed.
To Reproduce
electron:serve
- The App launches
- Dev Tools installed but not working
Expected behavior
- After running the same command with no code changes the VUE devtools then work this is random and far between ( Same app and code but successful build here )
Package.json
{ "name": "com.electron", "version": "0.1.0", "private": true, "scripts": { "serve": "vue-cli-service serve", "build": "vue-cli-service build", "lint": "vue-cli-service lint", "electron:build": "vue-cli-service electron:build", "electron:serve": "vue-cli-service electron:serve", "postinstall": "electron-builder install-app-deps", "postuninstall": "electron-builder install-app-deps", "test:e2e": "vue-cli-service test:e2e" }, "main": "background.js", "dependencies": { "client-oauth2": "^4.2.3", "core-js": "^2.6.5", "vue": "^2.6.10", "vue-router": "^3.0.6", "vuex": "^3.1.0" }, "devDependencies": { "@vue/cli-plugin-babel": "^3.7.0", "@vue/cli-plugin-e2e-cypress": "^3.7.0", "@vue/cli-plugin-eslint": "^3.7.0", "@vue/cli-service": "^3.7.0", "@vue/eslint-config-prettier": "^4.0.1", "babel-cli": "^6.26.0", "babel-eslint": "^10.0.1", "electron": "^5.0.0", "eslint": "^5.16.0", "eslint-plugin-vue": "^5.0.0", "vue-cli-plugin-electron-builder": "^1.3.1", "vue-template-compiler": "^2.5.21", "webpack-cli": "^3.3.1" }, "eslintConfig": { "root": true, "env": { "node": true }, "extends": [ "plugin:vue/essential", "@vue/prettier" ], "rules": {}, "parserOptions": { "parser": "babel-eslint" } }, "postcss": { "plugins": { "autoprefixer": {} } }, "browserslist": [ "> 1%", "last 2 versions" ] }
Additional context Not sure if the tools are trying to re install or there is a race condition before the browser loads? Or it might be silently failing?
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 13
- Comments: 26 (4 by maintainers)
I am using Electron 5 and ran into this issue as well. Nothing was being recognized by the extension, including the DOM and Vuex state.
I fixed it by closing the devtools window and reopening it (which can be done quickly by hitting the keybinding twice, e.g. Ctrl+Shift+I). It then recognized both the state and the DOM, and it continued working through hot reloads.
As an experiment, I tried delaying the initial
openDevTools()
call by several seconds, but it still did not work until I relaunched devtools.Same here. Opening an closing devtools fixes it, but all tabs are empty when electron loads the window.
What was the resolution to this problem? All of a sudden the thread says it works and it’s closed, but I’m not seeing what fixed it.
I encounter the same problem. I’m doing Vue.js development without electron in parallel and didn’t faced with this issue.
You could try putting
Vue.config.devtools = process.env.NODE_ENV === 'development';
in main.js before callingnew Vue
(https://github.com/vuejs/vue-devtools/issues/68). Otherwise, this might be due to using a non standard protocol (I looked in the extension’s manifest.json and it has this line:"permissions": [ "http://*/*", "https://*/*", "file:///*", "contextMenus" ]
.I think this issue has been solved, either from a vue devtools or electron update. Can someone confirm so this issue can be closed?
@travis5491811 No luck
Nope - sorry nothing for me. Still broken.
I was having the same problem - and it was fixed adding the vue.config.js code:
I only got this to work in electron 5. The comments say that it will not work in electron 6. FYI.
Good luck!
A callback hell dance to automatically close and reopen vue devtools, to make it detect the Vue application in electron. The timeout would probably need to be adjusted to the speed of your computer/browser.
Adding the
before
new Vue(...)
inmain.js
solved my problem 😃 but just when I run the project from the Terminal byBut If I run the project by VS Code Debug the problem is still there and Vue DevTools is empty again 😦
Additional information:
tasks.json
:launch.json
:vue.config.js
:@ant-i-c-s In development, the
http
protocol is used, so there should be no issues there. I’ve had the same issue, usually a few reloads and maybe restarting electron fixes it. I have the same issue using Quasar CLI, so i’m thinking this might be an issue with Vue Devtools, as the issue is not limited to this plugin’s implementation of Electron. Maybe you could open an issue there as well, and we can work together to solve this problem as it seems quite common.