Electron-vue: Upgrade electron to 5.0.0 beta fails

Created on 26 Mar 2019  路  6Comments  路  Source: SimulatedGREG/electron-vue

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

#
I was trying to upgrade the electron from 4.0.0 to 5.0.0 beta with yarn upgrade electron@beta, but the project raises errors when running npm run dev and the screen is blank.

Describe the issue / bug.

#
Uncaught ReferenceError: require is not defined at (index):1
Uncaught ReferenceError: module is not defined at renderer.js:1

How can I reproduce this problem?

#
npm run dev

If visual, provide a screenshot.

#

Tell me about your development environment.

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

Most helpful comment

You should specify the following option in src/main/index.js file

    webPreferences: {
      nodeIntegration: true,
    }, 

You can check my full answer here https://github.com/SimulatedGREG/electron-vue/issues/855#issuecomment-503002257

All 6 comments

Solved excuse me

Please explain your solution for others (like myself) looking for the same.

I am also looking for this answer. I also need to upgrade NodeJS to latest version.

Answer is now in #855

You should specify the following option in src/main/index.js file

    webPreferences: {
      nodeIntegration: true,
    }, 

You can check my full answer here https://github.com/SimulatedGREG/electron-vue/issues/855#issuecomment-503002257

hey @betterRunner check the answer here #855 and especially the last comment #855 (comment)

Was this page helpful?
0 / 5 - 0 ratings