corymsmith / react-native-icons

Quick and easy icons in React Native
MIT License
1.14k stars 141 forks source link

Still got error with react-native-webpack-server #118

Closed just4fun closed 8 years ago

just4fun commented 9 years ago

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 as import keyword) (UPDATE many days later: the es6/es7 features which React Native support is listed in node_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 delete index.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 got No visible @interface for 'RCT Wrapper ViewController'....

Any suggestions?

Thanks.

license2e commented 9 years ago

I am getting the same error with react-native-webpack-server

Module not found: Error: Cannot resolve module 'react-native-icons'
codecvlt commented 9 years ago

I have the same issue. Also using react-native-webpack-server.

slightlytyler commented 9 years ago

Same issue here. Anyone figure it out?

just4fun commented 9 years ago

I use react-native-vector-icons instead, everything works fine with react-native-webpack-server and latest React Native.

bradbenvenuti commented 9 years ago

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.

corymsmith commented 8 years ago

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.

corymsmith commented 8 years ago

Just pushed 0.6.1 to NPM, it should fix the issues you were seeing, let me know!

just4fun commented 8 years ago

@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).