Closed nickfan closed 5 years ago
Can you upload your background.js
as well? I've used IPC without issue before, so I want to see how you implement it.
ok,i found the reason,it's my design problem, i build my event listeners regist depends on the class name,in the DEV mode,it's fine for that,but after asar or webpack uglify plugin minify the production file,it will change the class name so my listeners regist flow stop working.
and i found that the only way to avoid that is
class SomeClass {
static getClassName(){ return 'SomeClass'; }
getClassName(){ return this.constructor.getClassName(); }
constructor() {}
}
reference:
https://stackoverflow.com/questions/29310530/get-the-class-name-of-es6-class-instance
Describe the bug i build my app with vue-cli-plugin-electron-builder it works fine when i'm develop with
electron:serve
akavue-cli-service electron:serve
but when i'm try to release the app,and run the app ipc renderer or ipc main function seems stop working on electron:build other function seems work fine(shell.openExternal,shell.showItemInFolder on the client side)at first i thought it might be the custom protocol problem,i switch back to 'app://./',it didn't work.
and i got nothing respone from log file or the devtools console, so i install devtron,and open the ipc panel: and i found message send from renderer but nothing responsed. and i could not find where to read from app(main) console, so how could i debug the problem?
To Reproduce Steps to reproduce the behavior:
Expected behavior A clear and concise description of what you expected to happen. ipcmain and ipcrenderer send and receive message from each side.
Screenshots If applicable, add screenshots to help explain your problem.
Environment (please complete the following information):
OS and version: mac 10.14.5
node version: v10.15.3
npm version: 6.9.0
yarn version (if used): 1.16.0
vue-cli-plugin-electron-builder version : 1.3.4
electron version: 5.0.1
other vue plugins used:
custom config for vcp-electron-builder:
(if possible) link to your repo:
Additional context Add any other context about the problem here.