I'm programming w/ angular9, and have everything working w/ esri-loader and v4.16. I tried to update to 4.18 so that I could ditch esri-loader (which breaks my automated tests, different story) for es modules. Most things seem to work and everything compiles. However...
My browser gets spammed w/ the error below and my maps never load.
"responseType 'image' is not supported in Web Workers or Node environment"
If I disabled nodeIntegration, the maps load but then I lose responsiveness and IPC. I've seen workarounds, but at the cost of security.
Am I just not permitted to upgrade to 4.18 es modules since I use electron (w/ nodeIntegration)?
Hi John, here's a proof-of-concept app showing how to use JS API 4.x ES modules with webpack 5 and Electron 11.2: https://github.com/andygup/electron-esri-map. This demonstrates that the underlying integration with webpack and electron is possible. What will be challenging is figuring out the right configuration permutations to get Angular, JS API ES modules, Webpack and Electron all to work together into one application.
With regards to writing unit tests, we will have a session at the upcoming 2021 Developer Summit includes insight on writing unit tests with JS API ES modules and Angular 11.
For future people that may come w/ the same question...
What I found is that nodeIntegration enabled so that you can do i2c communication w/ your app is NOT secure. Take a look on electron contextBridge: https://www.electronjs.org/docs/api/context-bridge
Once I made this switch, WMSLayer works and I technically made my app more secure.