t4t5 / react-native-router

Awesome navigation for your React Native app.
MIT License
1.17k stars 155 forks source link

error on react native 0.8 #53

Open aisk opened 9 years ago

aisk commented 9 years ago

I upgrade my project to react native 0.8, and saw this errors:

[15:48:07] <START> fs crawl
[15:48:07] <END>   fs crawl (428ms)
Unable to resolve module ./base64-vlq from /Users/asaka/Codes/FirstSight/node_modules/react-native-router/node_modules/react-native/Libraries/JavaScriptAppEngine/Initialization/SourceMap.js
Unable to resolve module ./util from /Users/asaka/Codes/FirstSight/node_modules/react-native-router/node_modules/react-native/Libraries/JavaScriptAppEngine/Initialization/SourceMap.js
Unable to resolve module ./array-set from /Users/asaka/Codes/FirstSight/node_modules/react-native-router/node_modules/react-native/Libraries/JavaScriptAppEngine/Initialization/SourceMap.js
Unable to resolve module ./base64 from /Users/asaka/Codes/FirstSight/node_modules/react-native-router/node_modules/react-native/Libraries/JavaScriptAppEngine/Initialization/SourceMap.js
Unable to resolve module ./util from /Users/asaka/Codes/FirstSight/node_modules/react-native-router/node_modules/react-native/Libraries/JavaScriptAppEngine/Initialization/SourceMap.js
Unable to resolve module ./util from /Users/asaka/Codes/FirstSight/node_modules/react-native-router/node_modules/react-native/Libraries/JavaScriptAppEngine/Initialization/SourceMap.js
Unable to resolve module ./binary-search from /Users/asaka/Codes/FirstSight/node_modules/react-native-router/node_modules/react-native/Libraries/JavaScriptAppEngine/Initialization/SourceMap.js
Unable to resolve module ./array-set from /Users/asaka/Codes/FirstSight/node_modules/react-native-router/node_modules/react-native/Libraries/JavaScriptAppEngine/Initialization/SourceMap.js
Unable to resolve module ./base64-vlq from /Users/asaka/Codes/FirstSight/node_modules/react-native-router/node_modules/react-native/Libraries/JavaScriptAppEngine/Initialization/SourceMap.js
Unable to resolve module ./source-map-generator from /Users/asaka/Codes/FirstSight/node_modules/react-native-router/node_modules/react-native/Libraries/JavaScriptAppEngine/Initialization/SourceMap.js
Unable to resolve module ./util from /Users/asaka/Codes/FirstSight/node_modules/react-native-router/node_modules/react-native/Libraries/JavaScriptAppEngine/Initialization/SourceMap.js
Unable to resolve module source-map/source-map-consumer from /Users/asaka/Codes/FirstSight/node_modules/react-native-router/node_modules/react-native/Libraries/JavaScriptAppEngine/Initialization/SourceMap.js
Unable to resolve module source-map/source-map-generator from /Users/asaka/Codes/FirstSight/node_modules/react-native-router/node_modules/react-native/Libraries/JavaScriptAppEngine/Initialization/SourceMap.js
Unable to resolve module source-map/source-node from /Users/asaka/Codes/FirstSight/node_modules/react-native-router/node_modules/react-native/Libraries/JavaScriptAppEngine/Initialization/SourceMap.js
Unable to resolve module ./base64-vlq from /Users/asaka/Codes/FirstSight/node_modules/react-native-router/node_modules/react-native/Libraries/JavaScriptAppEngine/Initialization/SourceMap.js
Unable to resolve module ./util from /Users/asaka/Codes/FirstSight/node_modules/react-native-router/node_modules/react-native/Libraries/JavaScriptAppEngine/Initialization/SourceMap.js
Unable to resolve module ./array-set from /Users/asaka/Codes/FirstSight/node_modules/react-native-router/node_modules/react-native/Libraries/JavaScriptAppEngine/Initialization/SourceMap.js
Unable to resolve module ./base64 from /Users/asaka/Codes/FirstSight/node_modules/react-native-router/node_modules/react-native/Libraries/JavaScriptAppEngine/Initialization/SourceMap.js
Unable to resolve module ./util from /Users/asaka/Codes/FirstSight/node_modules/react-native-router/node_modules/react-native/Libraries/JavaScriptAppEngine/Initialization/SourceMap.js
Unable to resolve module ./util from /Users/asaka/Codes/FirstSight/node_modules/react-native-router/node_modules/react-native/Libraries/JavaScriptAppEngine/Initialization/SourceMap.js
Unable to resolve module ./binary-search from /Users/asaka/Codes/FirstSight/node_modules/react-native-router/node_modules/react-native/Libraries/JavaScriptAppEngine/Initialization/SourceMap.js
Unable to resolve module ./array-set from /Users/asaka/Codes/FirstSight/node_modules/react-native-router/node_modules/react-native/Libraries/JavaScriptAppEngine/Initialization/SourceMap.js
Unable to resolve module ./base64-vlq from /Users/asaka/Codes/FirstSight/node_modules/react-native-router/node_modules/react-native/Libraries/JavaScriptAppEngine/Initialization/SourceMap.js
Unable to resolve module ./source-map-generator from /Users/asaka/Codes/FirstSight/node_modules/react-native-router/node_modules/react-native/Libraries/JavaScriptAppEngine/Initialization/SourceMap.js
Unable to resolve module ./util from /Users/asaka/Codes/FirstSight/node_modules/react-native-router/node_modules/react-native/Libraries/JavaScriptAppEngine/Initialization/SourceMap.js
Unable to resolve module source-map/source-map-consumer from /Users/asaka/Codes/FirstSight/node_modules/react-native-router/node_modules/react-native/Libraries/JavaScriptAppEngine/Initialization/SourceMap.js
Unable to resolve module source-map/source-map-generator from /Users/asaka/Codes/FirstSight/node_modules/react-native-router/node_modules/react-native/Libraries/JavaScriptAppEngine/Initialization/SourceMap.js
Unable to resolve module source-map/source-node from /Users/asaka/Codes/FirstSight/node_modules/react-native-router/node_modules/react-native/Libraries/JavaScriptAppEngine/Initialization/SourceMap.js
[15:48:10] <START> request:/index.ios.bundle
[15:48:10] <START> find dependencies
[15:48:10] <END>   find dependencies (108ms)
[15:48:10] <START> transform
[15:48:10] <END>   transform (75ms)
[15:48:10] <END>   request:/index.ios.bundle (199ms)

and saw the react native router is based on react 0.4. I removed the react deps in node_modules/react-native-router, and seems the project can run now.

I think we should remove the react deps, let user use react on there project, or move react to deps-dev.

leejms commented 9 years ago

Putting ReactNative as a project dependency will break future react updates because your project will install a different (older) version than the main project.

Also contributes to https://github.com/t4t5/react-native-router/issues/38

MikaelCarpenter commented 9 years ago

Neither of these seems to fix the problem for me? I bumped the version to "react-native": "^0.8.0" and still got the error, so i removed the dependency all together and still get the error.

EDIT: Nvm i'm an idiot. After bumping the version you have to cd node_modules/react-native-router and then npm install now it works.

piyushchauhan2011 commented 9 years ago

:+1:

miknonny commented 9 years ago

ok. cool. almost gave up!. thanks

clintonwoo commented 9 years ago

@MikaelCarpenter thank you! Your solution worked for me as well.