项目场景:
electron+react
问题描述
electron 中用IPC通信
Uncaught (in promise) Error: An object could not be cloned.
e Error: An object could not be cloned.at EventEmitter.i.invoke (node:electron/js2c/sandbox_bundle:33)at uploadImg (YakitPluginInfo.tsx:360)at AjaxUploader.post (AjaxUploader.js:323)at AjaxUploader.js:135at Array.forEach (<anonymous>)at AjaxUploader.js:134
原因分析:
传递的对象有方法就会报错
解决方案:
json.stringify()