简体   繁体   English

将大型Redux代码库添加到React Native /无法解决模块错误

[英]Adding large Redux code base to React Native / Unable to resolve module error

Has anyone else had problems adding a large redux code base to their RN projects? 还有其他人在向他们的RN项目添加大型Redux代码库时遇到问题吗? Redux was originally created for react web. Redux最初是为React Web创建的。 When I comment out the redux imports in my RN app, it works fine. 当我在RN应用中注释掉redux导入时,它工作正常。 When I uncomment them out I get a red screen with the "Unable to resolve module" error. 当我取消注释时,会出现红色屏幕,显示“无法解析模块”错误。

I've searched this error message and seen suggestions online, but none of them work for me so I'm making this post. 我已经搜索了此错误消息,并在网上看到了建议,但是没有一个对我有用,因此我正在发布这篇文章。 I'm reset watchman, killed extra processes running, reinstalled my node_modules many times and nothing seems to work. 我重设了值班员,杀死了正在运行的多余进程,多次重新安装了我的node_modules,但似乎无济于事。

This makes me wonder if it is possible to have something inside redux that might only work for the web and not mobile. 这让我想知道在redux中是否有可能仅适用于Web而不适用于移动设备的内容。 Can redux include something RN compile can't understand? redux可以包含RN编译无法理解的内容吗?

Has anyone else encountered this or have any ideas? 有没有其他人遇到这个或有任何想法?

To answer my own question: A duck requires react-intl and a file using react-int is Embedded JavaScript (.ejs) so that doesn't compile well with react native. 要回答我自己的问题:鸭子需要react-intl,而使用react-int的文件是嵌入式JavaScript(.ejs),因此不能与react native一起很好地编译。 Not sure how to fix it yet, but that is causing the problem. 尚不确定如何解决它,但这是导致问题的原因。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM