我正在使用 React & Fluxible & electron 处理应用程序流程,它遵循标准的 react 流程,即 component -> action -> store -> component
Action
在 ActionCreators
Action
会做fs.readfileSync
并将“完成”发送到 store
store
中的更改并渲染 component
再次。 当我即将将文件读入应用程序时,我在第 2 步失败了。它给了我一条错误消息:
Uncaught Error: process.binding is not supported
我想知道我是否做错了什么?谢谢。
最佳答案
fs 模块将无法在客户端上运行。您应该将文件访问权移至仅作为服务器的位置,并通过 XHR 端点公开它。如果您使用fluxible-plugin-fetchr,您可以在服务中执行此操作并从您的操作创建者处调用该服务。
关于reactjs - 不支持 Uncaught Error : process. 绑定(bind)(在 React、fluxible 和 Electron 中开发时),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31065142/