Redux-persist:无法解析模块“ react-native”

时间:2019-05-03 10:58:11

标签: reactjs typescript react-native redux redux-persist

我正在尝试在第三方NPM模块(如果有帮助的话,使用Typescript)中使用redux-persist。每当我尝试在实际项目(这是一个运行良好的React Native应用程序)中使用第三方模块(本地链接)时,都会出现以下错误:

error: bundling failed: Error: Unable to resolve module `react-native` from 
`path/to/my/3rd/party/module/node_modules/redux-persist/lib/storage/index.native.js`:
Module `react-native` does not exist in the Haste module map

Redux-persist指出它不需要React(正如它在自述文件中所说的“如果您正在使用react ...”,这意味着它也可以在没有React / React Native的情况下使用),为什么我得到了这样的错误?

我尝试过的事情:

我总是清除缓存,重新启动VScode和bundler等。

尽管我仍然遇到相同的错误。如何将redux-persist正确集成到我的party npm软件包中(可能与或不与React / React Native一起使用)

0 个答案:

没有答案