【发布时间】:2021-11-18 13:51:00
【问题描述】:
我目前正在尝试打包我的电子(-forge)(Webpack、React、TS)应用程序,该应用程序在渲染器进程中使用 electron-fetch :
const fetch = window
.require("electron").remote
.require("electron-fetch").default;
如果我以
yarn start
开头,则应用程序运行良好。
但是在运行打包的应用程序时(来自
yarn package
),我收到以下错误:
Uncaught Error: Cannot find module 'electron-fetch'
Require stack:
- path_to_app/resources/app/.webpack/main/index.js
删除 electron-fetch 后,打包的应用运行良好。
节点:v14.17.4
纱线:1.22.11