Skip to content
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

Closed
kfir91 opened this issue Jan 8, 2017 · 7 comments
Closed

Got error unresolved #47

kfir91 opened this issue Jan 8, 2017 · 7 comments

Comments

@kfir91
Copy link

kfir91 commented Jan 8, 2017

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

@skellock
Copy link
Contributor

skellock commented Jan 8, 2017

Are you using npm 2 by any chance?

@zurodtl
Copy link

zurodtl commented Jan 13, 2017

I have same issue, it worked fine on react-native 0.39.0 but got error on react-native 0.40.0

@ghost
Copy link

ghost commented Jan 18, 2017

It isn't related to version of RN. Try to install "apisauce": "0.7.0".

@skellock
Copy link
Contributor

I wonder if this is related? axios/axios#648

@skellock
Copy link
Contributor

No issue here with Android on Mac:

  • Android 6 api 23
  • React Native 40
  • Apisauce 0.8
  • Axios 15.3

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)

@skellock
Copy link
Contributor

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.

@GantMan
Copy link
Member

GantMan commented Jan 20, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants