You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I am using Angular and Electron with context isolation enabled in my application. In development mode, everything works fine, but in production mode, I am getting the global is undefined error. I have tried the following solutions without success:
Setting nodeIntegration to false
Setting contextIsolation to true
Setting enableRemoteModule to false
Referencing global as window.global
I am using the latest versions of Angular and Electron. It is not feasible for me to switch to a different framework or downgrade Electron at this time.
To Reproduce
Steps to reproduce the behavior:
Enable context isolation in Electron.
Build and run the application in production mode.
Observe the global is undefined error.
Expected behavior
The application should run without errors in production mode with context isolation enabled.
build and launch the app with npm run electron:build
Changing contextIsolation breaks how electron is injected in the renderer global variable window so isElectron() function in electron.service.ts always return false in the default project template.
So context isolation may not be the issue here.
Maybe the combinaison of other parameters you changed ? or a 3rd party library you are using on your project ? or the way you have exposed electron API from context bridge ?
Describe the bug
I am using Angular and Electron with context isolation enabled in my application. In development mode, everything works fine, but in production mode, I am getting the global is undefined error. I have tried the following solutions without success:
To Reproduce
Expected behavior
The application should run without errors in production mode with context isolation enabled.
Screenshots
![19 - Copy (2)](https://user-images.githubusercontent.com/80245924/221866354-01038a02-97f0-4e5c-b2cc-269101dfca57.png)
Additional context
Tried below solutions, none worked. Do you know the fix @maximegris ?
webpack/webpack#10035
https://stackoverflow.com/questions/65586906/react-and-electron-with-draft-js-global-is-not-defined/67336441#67336441
facebook/fbjs#290
electron/forge#1498
https://stackoverflow.com/questions/74718063/how-to-enable-context-isolation-in-electron-js-next-js-nextron
The text was updated successfully, but these errors were encountered: