vue-cli-plugin-electron-builder: cannot Launching Electron... Failed to fetch extension
I create a new vue project using vue cli 3:vue create pc-client
, then vue add electron-builder
, but fail to launch app by yarn serve:electron
.
Any helps and advice for me? thanks.
Describe the bug cannot launch an electron app sucssefully when run yarn serve electron
To Reproduce
$ vue create pc-client #So the code is generated by vue cli by default. I don't modify them.
$ cd my pc-client
$ vue add electron-builder
$ yarn serve:electron
even after try:
yarn add electron-devtools-installer -D
#and
vue invoke electron-builder
It still fails.
Expected behavior launch electron app normally
Screenshots
Environment (please complete the following information):
- OS and version: macOS Sierra V10.12.4
- Node version: v8.11.3
- npm version: 5.6.0
- yarn version (if used): 1.7.0
- vue-cli-plugin-electron-builder version : “^1.0.0-rc.1”
- other vue plugins used:
- custom config for vcp-electron-builder:
- (if possible) link to your repo:
- my package.json and other all configs are default:
"name": "pc-client",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
"test:unit": "vue-cli-service test:unit",
"test:e2e": "vue-cli-service test:e2e",
"build:electron": "vue-cli-service build:electron",
"serve:electron": "vue-cli-service serve:electron",
"postinstall": "electron-builder install-app-deps"
},
"dependencies": {
"vue": "^2.5.17",
"vue-router": "^3.0.1",
"vuex": "^3.0.1"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^3.0.1",
"@vue/cli-plugin-e2e-cypress": "^3.0.1",
"@vue/cli-plugin-eslint": "^3.0.1",
"@vue/cli-plugin-unit-mocha": "^3.0.1",
"@vue/cli-service": "^3.0.1",
"@vue/test-utils": "^1.0.0-beta.20",
"chai": "^4.1.2",
"electron": "^2.0.2",
"electron-devtools-installer": "^2.2.4",
"node-sass": "^4.9.0",
"sass-loader": "^7.0.1",
"vue-cli-plugin-electron-builder": "^1.0.0-rc.1",
"vue-template-compiler": "^2.5.17"
},
"main": "dist_electron/bundled/background.js"
}
Additional context
$ yarn serve eclectron
//… App running at:
- Local: http://localhost:8080/
- Network: http://192.168.0.105:8080/
Note that the development build is not optimized. To create a production build, run yarn build.
Bundling main process:
Hash: f66bb9d91e4b7005676d Version: webpack 4.17.1 Time: 1154ms Built at: 2018-09-02 21:33:03 Asset Size Chunks Chunk Names background.js 641 KiB background [emitted] background Entrypoint background = background.js [./node_modules/rimraf/rimraf.js] 8.78 KiB {background} [built] [./node_modules/unzip-crx/dist/index.js] 2.33 KiB {background} [built] [./node_modules/vue-cli-plugin-electron-builder/lib/createProtocol.js] 1.22 KiB {background} [built] [./node_modules/vue-cli-plugin-electron-builder/lib/installVueDevtools/utils.js] 1.28 KiB {background} [built] [0] multi ./src/background.js 28 bytes {background} [built] [./node_modules/vue-cli-plugin-electron-builder/lib/index.js] 132 bytes {background} [built] [./node_modules/vue-cli-plugin-electron-builder/lib/installVueDevtools/downloadChromeExtension.js] 1.81 KiB {background} [built] [./node_modules/vue-cli-plugin-electron-builder/lib/installVueDevtools/index.js] 1.6 KiB {background} [built] [./src/background.js] 2.1 KiB {background} [built] [electron] external “electron” 42 bytes {background} [built] [fs] external “fs” 42 bytes {background} [built] [https] external “https” 42 bytes {background} [built] [module] external “module” 42 bytes {background} [built] [path] external “path” 42 bytes {background} [built] [url] external “url” 42 bytes {background} [built] + 108 hidden modules
Launching Electron… Failed to fetch extension, trying 4 more times Failed to fetch extension, trying 3 more times Failed to fetch extension, trying 2 more times Failed to fetch extension, trying 1 more times Failed to fetch extension, trying 0 more times (node:8472) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: net::ERR_CONNECTION_TIMED_OUT (node:8472) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 16 (8 by maintainers)
@Huqin-China I have confirmed, the reason is the Firewall. 翻墙就好了
I don’t get the error when I tried it, so it is probably an issue with your system only. In a working electron instance, run
require('electron').remote.app.getPath('userData')
in the console. Delete theextensions
folder inside of the path returned. Then, try it again.