-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Got error unresolved #47
Comments
Are you using npm 2 by any chance? |
I have same issue, it worked fine on react-native 0.39.0 but got error on react-native 0.40.0 |
It isn't related to version of RN. Try to install "apisauce": "0.7.0". |
I wonder if this is related? axios/axios#648 |
No issue here with Android on Mac:
It must be a Windows thing? I'll poke around some more. Source if you're interested. /**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react'
import {
AppRegistry,
StyleSheet,
Text,
View
} from 'react-native'
import {create} from 'apisauce'
// define the api
const api = create({
baseURL: 'https://api.github.com',
headers: {'Accept': 'application/vnd.github.v3+json'}
})
export default class ApisauceTest extends Component {
callApi () {
// start making calls
api
.get('/repos/skellock/apisauce/commits')
.then((response) => response.data[0].commit)
.then(console.log)
}
render () {
const callApi = this.callApi.bind(this)
return (
<View style={styles.container}>
<Text style={styles.welcome} onPress={callApi}>
Welcome to React Native!
</Text>
</View>
)
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF'
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5
}
})
AppRegistry.registerComponent('ApisauceTest', () => ApisauceTest) |
So @GantMan and I tracked it down to: https://github.com/mzabriskie/axios/blob/master/lib/defaults.js#L23 Comment that line on out on Windows and the packager will finish it's transform process. More details when we ask some people at Facebook about how the packager works. |
after i installed the apisauce i got error:
transformed 416/417 (100%)(node:2216) UnhandledPromiseRejectionWarning: Unhandle
d promise rejection (rejection id: 290): UnableToResolveError: Unable to resolve
module http from F:\ReactNative\test\node_modules\axios\lib\adapters\http.js: M
odule does not exist in the module map or in these directories:
F:\ReactNative\test\node_modules
i work with windows 7, npm and android
the files exists in the directory...
The text was updated successfully, but these errors were encountered: