I am currently in the process of packaging my electron(-forge) (Webpack, React, TS) application that utilizes electron-fetch in the renderer process with:
const fetch = window
.require("electron").remote
.require("electron-fetch").default;
During testing with yarn start
, the application functions as expected.
However, upon running the packaged application (via yarn package
), an error is encountered:
Uncaught Error: Cannot find module 'electron-fetch'
Require stack:
- path_to_app/resources/app/.webpack/main/index.js
The packaged app works correctly when electron-fetch is excluded from the codebase.
Environment Details: Node v14.17.4, Yarn 1.22.11