Electron 13 + Webpack -> require is not defined
See original GitHub issueAfter updating plugin to 2.1.0 and Electron to 13.1.4 on app startup getting following error visible in console:
external "events"?7a7e:1 Uncaught ReferenceError: require is not defined at eval (external "events"?7a7e:1) at Object.events (app.js:3462) at __webpack_require__ (app.js:790) at fn (app.js:151) at eval (emitter.js?a6bd:1) at Object../node_modules/webpack/hot/emitter.js (chunk-vendors.js:22893) at __webpack_require__ (app.js:790) at fn (app.js:151) at eval (dev-server.js?6895:50) at Object../node_modules/webpack/hot/dev-server.js (chunk-vendors.js:22882)
Problematic line in node_modules/webpack/hot/dev-server.js
var hotEmitter = require("./emitter");
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Electron Webpack `require is not defined` - Github-Gist
If you're using Webpack to bundle your Electron app and you're getting require is not defined , and you don't want to set...
Read more >'Require is not defined' when adding electron-renderer to ...
I understand that adding the following line to my Webpack config would allow me to import electron on the renderer side. module.exports =...
Read more >How to solve require is not defined in electronjs - YouTube
How to solve require is not defined in electron js ?Solution:I have solved this issue by updating ElectronJs VersionLet Update it to the ......
Read more >uncaught referenceerror: require is not defined - You.com
If you are getting an Uncaught ReferenceError: require is not defined error, it likely means that you are attempting to use the require()...
Read more >electron referenceerror require is not defined Code Example
This can happen if: * Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Electron is replacing
nodeIntegration=true
withcontextIsolation=false
. I think that was causing your issue as it would explain why upgrading electron broke it and addingcontextIsolation=false
fixed it.doc not update