electron-vue icon indicating copy to clipboard operation
electron-vue copied to clipboard

error occurred in the main process when call ipcRenderer.send

Open lihuimaichel opened this issue 5 years ago • 1 comments
trafficstars

Found an issue or bug with electron-vue? Tell me all about it!

Questions regarding how to use electron or vue are likely to be closed as they are not direct issues with this boilerplate. Please seek solutions from official documentation or their respective communities.

Describe the issue / bug.

# A Java Script error occurred in the main process Uncaught EXception : TyPeError: Insufficient number of arguments . at EventEmitter.eval(webpack:///./src/main/index.js?:58:14) at emitTwo (events.js:126:13) at EventEmitter.emit (events.js:214:7) at WebContents.Umedia/lihy/works2/2019code/electron2/dudubrowser/node_modules/electron/dist/resources/electron.asar/browser/api/web-contents.js:287:13) at emitTWo (events.js:126:13) at WebContents.emit(events.js:214:7)

How can I reproduce this problem?

# ==>rendere code:==== `

Create New Window
`

===main code=== ipcMain.on('createNewWindow', (event, arg) => { console.log(event) console.log(arg) // if (windows[arg] !== undefined) return const session = require('electron').session var webSession = session.defaultSession webSession.setProxy({ pacScript: path.join('file://', __dirname, '/proxy.pac') }) windows[arg] = new BrowserWindow({ width: 800, height: 600, frame: false, webPreferences: { preload: path.join(__dirname, 'preload.js'), webviewTag: true, session: webSession } }) windows[arg].loadURL('https://www.baidu.com') windows[arg].on('close', () => { windows[arg] = null }) })

If visual, provide a screenshot.

# image

Tell me about your development environment.
  • Node version:8.9.3
  • NPM version:6.10.1
  • vue-cli version: (if necessary) 2.6.11
  • Operating System:Debian 7.3.0-19
  • Vue.js:2.6.11
  • Electron:2.0.18
  • Platform:linux

If you are looking to suggest an enhancement or feature, then feel free to remove everything above.

lihuimaichel avatar Dec 27 '19 02:12 lihuimaichel

update Electron version , maybe

webdq avatar Dec 14 '20 02:12 webdq