I am constructing a desktop application using Electron in tandem with ReactJS.
I open a new, invisible BrowserWindow from the first renderer process to launch another renderer process. In this new renderer process, I register a web worker where an API call will be periodically called to fetch data.
This is the code in the invisible window HTML script tag to register the web worker:
let installWebWorker = () => {
console.log("installWebWorker()");
if (typeof(Worker) !== "undefined") {
console.log("Web worker supported");
let monitorsWorker = new Worker("fetchMonitors.js");
} else {
console.log("Sorry! No Web Worker support...");
}
}; //end installWebWorker()
installWebWorker();
In the fetchMonitors.js worker itself, I require the "electron-is-dev" node module to make the fetch API call in development. To do so, I use require("electron").remote.require("electron"). I obtain the following error:
DevTools Error:

This error leads me to believe that Electron NodeJS modules are not supported in web workers. The Electron documentation here says otherwise, however.