-
Notifications
You must be signed in to change notification settings - Fork 106
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
fetch is undefined in React Native #26
Comments
Also reported here. |
mattmccutchen
added a commit
to mattmccutchen/cross-fetch
that referenced
this issue
Oct 21, 2018
As Matt noted in the Stackoverflow question, activating |
lquixada
pushed a commit
that referenced
this issue
Oct 25, 2018
@lquixada Do you have an estimate of when this will be released? |
@sondremare hopefully this weekend. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've written an API wrapper that uses cross-fetch to make it compatible with Browsers, Node and React Native. Now, if I test it with Node it works perfectly, but if I use the wrapper in React Native if fails with the following error:
TypeError: undefined is not a function (evaluating 'cross_fetch_1.default(url, init)')
. If I print the type ofcross_fetch_1
I get:and "undefined" for either
cross_fetch_1.default
orcross_fetch_1.fetch
.The library was developed in Typescript, so the cross_fetch_1 variable is created by the TS compiler. You can find the Typescript code here https://github.com/tgamauf/onetimesecret-api/blob/1b8edff66bde11807c8ff7d29030b4d3e6661277/lib/request.ts#L150 and the compiled JS here https://github.com/tgamauf/onetimesecret-api/blob/1b8edff66bde11807c8ff7d29030b4d3e6661277/lib/request.js#L179.
As far as I can tell I am using the module as it is supposed to be used. What could cause this?
The text was updated successfully, but these errors were encountered: