Closed just4fun closed 8 years ago
I am getting the same error with react-native-webpack-server
Module not found: Error: Cannot resolve module 'react-native-icons'
I have the same issue. Also using react-native-webpack-server.
Same issue here. Anyone figure it out?
I use react-native-vector-icons instead, everything works fine with react-native-webpack-server and latest React Native.
It looks like version 0.5.1 is missing a "main" entry in the package.json. Adding:
"main": "index.ios.js",
should fix it for iOS.
Do you have any good examples of newer modules that have both iOS and Android native modules and that work well with react-native-webpack-server? That would help me update this lib to work well with it as well. I initially had to remove the main entry in package.json so the react packager would pick up my platform specific index files.
Just pushed 0.6.1 to NPM, it should fix the issues you were seeing, let me know!
@bradbenvenuti @corymsmith Thanks for your reply.
In my case, since I used 0.12.0 of React Native, which didn't add es6.modules
in node_modules/react-native/packager/react-packager/.babelrc
, and at the beginning of my React Native journey, I didn't know I can add extra .babelrc
in my root path to replace the one in the packager, so I considered use babel and webpack to use es6.
Now I upgraded React Native to 0.13.X, I got rid of babel and webpack with the new .babelrc
in the packager.
I think your fix will also works with react-native-webpack-server
, thanks again.
I also updated the description for this issue (see bold text above).
Hey man,
I used React Native 0.12.0, so I installed latest 0.5.1, and then follow the getting started. The Xcode could build successfully, but I always got
Module not found: Error: Cannot resolve module 'react-native-icons'
when I started my node server. Since React Native didn't support all ES6 features (such asimport
keyword) (UPDATE many days later: the es6/es7 features which React Native support is listed innode_modules/react-native/packager/react-packager/.babelrc
, you can also add your own.babelrc
in your root path to replace it. That said, we can get rid of babel and react-native-webpack-server if we just want to use es6/es7 in React Native), so I used webpack (and babel-loader) to start the server. To use webpack, I should use react-native-webpack-server, it suggested us to deleteindex.ios.js
and created new entry in our project. I'm not sure whether it's the root cause to got that error.Then I want to use 0.4.0, in this time, I could start my node server successfully (b/c there is
index.js
), but when I build in Xcode, I always gotNo visible @interface for 'RCT Wrapper ViewController'...
.Any suggestions?
Thanks.