XHR request cancelled with electron 9 beta 9
See original GitHub issueDescribe the bug Since electron 9 can open pdf (see : https://github.com/electron/electron/issues/12337), I tried to use vue-cli-plugin-electron-builder with electron 9.
But every xhr requests are canceled in production mode, ie after running npm run electron:build
and launching the app.
I know electron 9 is not supported by vue-cli-plugin-electron-builder but sending requests with axios without any vue instance is working.
NB : it’s working with electron 9 beta 5
Is this bug due to electron 9, vue-cli-plugin-electron-builder or both?
To Reproduce
- Create empty vue app :
vue create empty-vue-app
- Add vue-cli-plugin-electron-builder :
vue add vue-cli-plugin-electron-builder
- Add vue-resource :
npm i vue-resource
- Make an XHR request in HelloWorld.vue
or clone this project : https://github.com/Brutia/electron-vue-empty-app (I use google URL, normally you should get a CORS error, but the request is canceled)
Replace 9.0.0-beta.9 in package.json by 9.0.0-beta.5 and it will work as expected
Expected behavior Request send and response received
Environment (please complete the following information):
- OS and version: Windows 10
- node version: 12.16.1
- npm version: 6.13.4
- yarn version (if used):
- vue-cli-plugin-electron-builder version : 1.4.6
- electron version: 9.0.0-beta.9
- other vue plugins used:
- custom config for vcp-electron-builder:
- (if possible) link to your repo: https://github.com/Brutia/electron-vue-empty-app
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
When I built the app I got the error. This definitely looks like an issue with electron as it only shows up for certain versions and the plugin wouldn’t cause this. You should open an issue on their repo instead.
It worked fine for me on linux:
I will have to try on windows and see if that causes it. Since it works fine with a different version of electron, my guess is that it is a problem with electron, not this plugin. Try creating an electron app without this plugin and see if you get the same error.