-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Uncaught ReferenceError: require is not defined #925
Comments
As of version 5, the default for nodeIntegration changed from true to false. You can enable it when creating the Browser Window mainWindow = new BrowserWindow({
webPreferences: {
nodeIntegration: true
}
}) |
https://electronjs.org/docs/faq I try many demo ,but their electron version is too old , I have to use the latest version and config group. Now ,this repo is the best and every feature is passed except for unit test Electron 6.0.10 (Node 12.4.0) ERROR |
check the answer here #855 |
I am also encountering this problem. I have tried many solutions found both here and elsewhere and none seem to be working. My dependencies all seem to be up to date (Electron is at 7+), and
My project has just reached the point where TDD is a necessity, so this has the potential to completely halt my development until I can find a fix. EDIT: Mac OS Mojave 10.14.5, Node 12.8.1, NPM 6.13.0 |
Same here. Also tried updating karma-electron to the newest version 6.3.0 which is supposed to solve the Windows 10, Electron 6.0.12, Node 12.4.0, npm 6.4.1 |
Had anybody solved this? o.0 I get the same |
Describe the issue / bug.
# Hi,When I upgrade to electron 5+,and run "yarn run unit",I got a error from the result .
So I try some method ,just like replace webpack target , delete nodejs lib in render directory, add the global windows.require, but all the methods has no working.
19 09 2019 09:41:24.192:INFO [Electron 6.0.9 (Node 12.4.0)]: Connected on socket VGoQJwhg7brt0Hs-AAAA with id 23424134
Electron 6.0.9 (Node 12.4.0) ERROR
Uncaught ReferenceError: require is not defined
at webpack:///external%20%22fs%22:1:1 <- index.js:2:130124
Electron 6.0.9 (Node 12.4.0): Executed 0 of 0 ERROR (1.413 secs / 0 secs)
Dose any body can run this project by electron 5+ ?
How can I reproduce this problem?
# upgrade to electron 5+,and run "yarn run unit"
If visual, provide a screenshot.
#
![image](https://user-images.githubusercontent.com/6058537/65207219-92ed1680-dac3-11e9-8073-dbf2a250c0dc.png)
Tell me about your development environment.
If you are looking to suggest an enhancement or feature, then feel free to remove everything above.
The text was updated successfully, but these errors were encountered: