-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unable to resolve module react-dom
#2054
Comments
@wanxsb 检查你自己的配置, RN 组件没有用到 rc-animate,只在 web 用到;或者把项目传到 github 给个地址 |
@wanxsb 看文档 https://mobile.ant.design/docs/react/introduce-cn#按需加载 如果不使用 babel-plugin-import 就需要写成 import Toast from 'antd-mobile/lib/toast';
import List from 'antd-mobile/lib/list'; |
我使用了
|
@xbt1 我也是,用了 import Toast from 'antd-mobile/lib/toast';
import List from 'antd-mobile/lib/list'; ant-mobile版本 |
改成
第一段代码是在开发环境中用到了按需加载,正确的应该是第二种。官方提供的示例代码中,README代码是正确的,.babelrc中提供了第一段代码但它是在开发环境下的。 |
@wanxsb @silentcloud @xbt1 @zim-lee @zxj963577494 请问这个问题解决了吗? 我这 RN 是 0.52.1,没有用到 expo,也是这个问题。 |
@arniu 参照@zxj963577494 给的配置,我现在的配置也是这样,运行没问题 |
@zim-lee @zxj963577494 非常感谢,我也成功了~ 我这没有用 crna,所以 总结下来,如果直接使用 react-native,antd-mobile 的安装过程如下:
@sorrycc 貌似 |
@arniu RN 0.55.3 android 仍然会出现unable to resolve module |
@fallenner 貌似是 |
Error still happens to me:
dev:
Any fix described above doesn't work |
+1 Environment: |
Also happening for me when using Calendar. Ubuntu 16.04 |
2.2.0即使按上面的配置也还是报错,回退成2.1.7版本可以了 |
+1 |
+10086 |
nice,退到2.15就好了 |
Version
2.0.2
Environment
系统版本macOS 10.12.6, react-native 0.47
Reproduction link
https://github.com/yiminghe/css-animation/blob/master/src/Event.js#L22
Steps to reproduce
在项目中运行npm install --save antd-mobile,获得依赖库如下
在项目中使用
import { Toast} from 'antd-mobile';
Toast.info(message, 1)
但是运行时出现依赖react-dom的错误
"Unable to resolve module
react-dom
from `/Users/xiesubin/Workspace/Project/seller-pad-rn/node_modules/rc-animate/lib/AnimateChild.js使用 npm install --save react-dom安装依赖后,会再出现
document.createElement not defined错误,
报错位置为css-animation/blob/master/src/Event.js 22
https://github.com/yiminghe/css-animation/blob/master/src/Event.js#L22
怀疑是antd-mobile的依赖库的问题
What is expected?
期望的结果是不报错
What is actually happening?
"Unable to resolve module
react-dom
from `/Users/xiesubin/Workspace/Project/seller-pad-rn/node_modules/rc-animate/lib/AnimateChild.js项目的依赖库如下:
The text was updated successfully, but these errors were encountered: