Replies: 2 comments 3 replies
-
@electron-toolkit\utils 是主进程模块,不能在渲染进程中使用,你的需求不在于这个模块,多窗口通讯,通过ipc交换数据 |
Beta Was this translation helpful? Give feedback.
1 reply
-
@alex8088 我在主进程里创建 worker 时遇到了同样的问题:TypeError: Cannot read properties of undefined (reading 'isPackaged'),但我无法定位到是哪里出了问题,想问一下这个报错可能是什么原因导致?我在 worker 里第一行打 console log 控制台没什么输出。worker 的引入方式,按照文档里给的两种都试过,均报这个错误。 |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
由于性能原因,我打算把部分业务逻辑挪到第二个窗口中运行,这样的话 当压力大的时候就不会导致主窗口卡顿
但是我这么做了之后,运行报错,错误来源是@electron-toolkit\utils\dist\index.js 错误内容是Cannot read properties of undefined (reading 'isPackaged')
我分析是渲染进程里面拿不到app
于是我尝试把这部分业务逻辑挪到worker进程中,同样的问题产生了
但是移除@electron-toolkit\utils ,成本又太高了
所以请问大家有什么好的办法解决吗?在运行很重的业务的时候,如何能不卡顿主线程
Beta Was this translation helpful? Give feedback.
All reactions