I have an angular application running standalone, and am trying to create an electron app that then just does: mainWindow.loadURL('http://localhost:4200/'); It is only localhost for my dev environment, it real conditions it will not be.
In electron I'm setting nodeIntegration to true, which is allowing my angular app to access ipc.
const mainWindow = new BrowserWindow({
webPreferences: {
nodeIntegration: true,
}
});
In angular I have my ping-pong function:
public playPingPong() {
if(this._electronService.isElectronApp) {
console.log('Is electron.')
console.log(this._electronService.ipcRenderer);
let pong: any = this._electronService.ipcRenderer.sendSync('ping', 'ping');
console.log(pong);
}
}
The application errors out though after logging the ipcRenderer with the error from the title:
core.js:5845 ERROR Error: Unable to deserialize cloned data due to invalid or unsupported version.
at EventEmitter../lib/renderer/api/ipc-renderer.ts.ipcRenderer.sendSync (ipc-renderer.ts:13)
at ArcMapComponent.playPingPong (arc-map.component.ts:61)
at ArcMapComponent.ngOnInit (arc-map.component.ts:164)
at callHook (core.js:3909)
at callHooks (core.js:3873)
at executeInitAndCheckHooks (core.js:3814)
at refreshView (core.js:11723)
at refreshDynamicEmbeddedViews (core.js:13070)
at refreshView (core.js:11728)
at refreshComponent (core.js:13145)
Thank you in advance!