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

React Native: undefined is not an object (evaluating ‘r.fetch.bind’) imported from null #9

Open
siddharthlatest opened this issue Feb 1, 2018 · 2 comments

Comments

@siddharthlatest
Copy link

On the lines of #8, we're seeing an issue with a library we are building @appbaseio/reactivesearch-native that has a dependency that uses fetch-everywhere.

Exact error:

Device: (1069:6932) Failed to install module ‘@appbaseio/reactivesearch-native’: undefined is not an object (evaluating ‘r.fetch.bind’) imported from null

Do you have any pointers on how we could resolve it?

This is an online environment where the error can be seen: https://snack.expo.io/@siddharthlatest/reactivesearch-snack

@siddharthlatest
Copy link
Author

I think this is the likely root cause:
https://github.com/lucasfeliciano/fetch-everywhere/blob/master/fetch-npm-browserify.js#L6

On react-native environment, L7 somehow evals to this.fetch.bind(this) which causes the error. See this snack snippet that demonstrates this - https://snack.expo.io/B1gJ6nx8G.

Error log on this snippet:

screen shot 2018-02-01 at 9 45 47 pm

@siddharthlatest siddharthlatest changed the title React Native and snack: undefined is not an object (evaluating ‘r.fetch.bind’) imported from null React Native: undefined is not an object (evaluating ‘r.fetch.bind’) imported from null Feb 1, 2018
@jhubbardsf
Copy link

The solution to this is posted here. I found it after a lot of searching. I'll fix it and put in the pull request in a few. Until it's merged you can monkey patch it in your app yourself or use my fork. Although I do realize this is a very old issue.

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

2 participants