electron-vite-react icon indicating copy to clipboard operation
electron-vite-react copied to clipboard

渲染进程使用node模块报错

Open xifanfanxi opened this issue 1 year ago • 1 comments

Describe the bug

Error: Dynamic require of "fs" is not supported

v2.1.0用的vite4没有问题 使用main分支用到了vite5, 没法直接使用node模块

xifanfanxi avatar Sep 02 '24 08:09 xifanfanxi

在渲染进程,不允许直接使用node提供的底层方法,你可以在主进程写函数,然后通过ipcRender通信传给渲染进程使用

zhangyicheng95 avatar Jan 14 '25 07:01 zhangyicheng95