材料-ui对React 15.4.0的破坏性变化的反应?"无法解析模块'react/lib/EventPluginHub'"

Car*_*man 16 reactjs material-ui

React v 15.4.0今天早上发布,似乎包含了一个修改了react-tap-event-plugin v1.0.0的更改产生了这个错误:

$ npm build
> myProject@0.1.47 build /.../myProject
> node scripts/build.js
Creating an optimized production build...
Failed to create a production build. Reason:
Module not found: Error: Cannot resolve module 'react/lib/EventPluginHub' in /.../myProject/node_modules/react-tap-event-plugin/src
Run Code Online (Sandbox Code Playgroud)

(注意:我稍微清理了输出)

根据THIS react-tap-event问题日志版本2.0.0的react-tap-event修复了构建问题.但是,material-ui仍然使用react-tap-event 1.0.0版.这里有什么选择?我能想到的唯一选择是:

  • 降级反应和其他包,如上面的链接所述
  • 等待Material-UI升级到react-tap-event 2.0.0

还有其他解决方案吗?据我所知,如果我想使用反应15.4.0,我几乎死在水中.

Jus*_*ave 11

几乎确保您将react-tap-event-plugin更新为正确版本的react.

  • 如果使用react ^ ^ 15.4.0,请在package.json中具体更新material-ui到`^ 0.16.0`和react-tap-event-plugin到`^ 2.0.0` (8认同)

小智 7

material-ui版本0.16.3已发布以解决此问题.