SimulatedGREG / electron-vue

An Electron & Vue.js quick start boilerplate with vue-cli scaffolding, common Vue plugins, electron-packager/electron-builder, unit/e2e testing, vue-devtools, and webpack.
https://simulatedgreg.gitbooks.io/electron-vue/content/
MIT License
15.48k stars 1.55k forks source link

Bug Electron 5.0.0 #865

Closed Kaa10 closed 5 years ago

Kaa10 commented 5 years ago

updating to electron 5.0.0 occurs errors as shown below. Note: To install the final electro 5.0.0 it is necessary to install the packages before:

I've tried uninstalling and installing again, but to no avail! So far I have returned to version 4.1.4 which is running smoothly. npm i electron@latest electron debug app

Fndroid commented 5 years ago

default value of webPreferences.nodeIntegration is false in Electron 5.0.0

so what you can do is set it to true in src/main/index.js

yaoleia commented 5 years ago

mainWindow = new BrowserWindow({ webPreferences: { nodeIntegration: true, nodeIntegrationInWorker: true, webSecurity: false } })

serhii-cherednyk commented 5 years ago

I have the same issue. Did you find a solution?

Kaa10 commented 5 years ago

Hello.

I did it in my code as yaoleia commented.

It's work

mainWindow = new BrowserWindow({ webPreferences: { nodeIntegration: true, nodeIntegrationInWorker: true, webSecurity: false } })

Thanks

serhii-cherednyk commented 5 years ago

Hello.

I did it in my code as yaoleia commented.

It's work

mainWindow = new BrowserWindow({ webPreferences: { nodeIntegration: true, nodeIntegrationInWorker: true, webSecurity: false } })

Thanks

could u send me your package.json?

Vmadmax commented 5 years ago

@serhii-cherednyk in index.js replace:

mainWindow = new BrowserWindow({
    height: 563,
    useContentSize: true,
    width: 1000
  })

with:

mainWindow = new BrowserWindow({
    height: 563,
    useContentSize: true,
    width: 1000,
    webPreferences: {
      nodeIntegration: true,
      nodeIntegrationInWorker: true,
      webSecurity: false
    }
  })