-
Notifications
You must be signed in to change notification settings - Fork 348
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 Horizon client issue - fetch import #477
Comments
Just removing or commenting out that line and the line above inside To fix that you need to replace Edit: Still doesn't work though, but now there's no obvious errors. It just fails silently. :/ |
Oh my. Why does this still fail for some? The error above means that the imports-loader cant be found. Could you test if it works if you replace "imports" and "exports" with "imports-loader" and "exports-loader"? Are you bundling with webpack? |
@mrlundis Jup, too bad. |
@flipace I'm also trying to run horizon inside a React Native app and I get the same error when replacing imports and exports as you suggested. |
Okay thanks for the info. I thought this issie was resolved, but it seems that it's still open for react native/non-webpack packagers. Will try to find a different workaround. Thanks for trying! |
@flipace In Relay they had an issue with RN and fetch as well. facebook/relay#26
|
@arthurvi afaik you cannot do conditional requires in RN. What exactly does |
Yeah, it's webpack syntax. Maybe there's some way we can move that stuff into the webpack config. I think you can apply certain modifiers automatically |
@rt2zz Bummer, haven't tested it. |
Ok, so we should probably special case fetch in the config to use the imports loader stuff. I'll check it out later today. I've been meaning to look closer at webpack, it's kind of a beast |
I'm also having this issue. Any possible temp workaround, guys? |
+1 |
@flipace what do you mean by "open for non-webpack programmers"? I'm using Webpack and I still get this issue. What do I do wrong? I just I thought installing |
Same, I can't use horizon at the moment. This makes me a sad 🐼 |
@jvorcak, @CoreyTrombley, @OleksandrBezhan: unfortunately, you're pulling in the source for the client that includes unprocessed Webpack directives. You can try to import the compiled client library with:
We're working on improving the package to make this easier. Sorry you ran into this! |
@mglukhovsky is there any workaround you could suggest for now? I'd like to at least experiment and learn till it's ready. |
@jvorcak try importing |
@deontologician thanks for the help. However, this one I tried before and didn't really help. I start getting this error http://pastebin.com/A0J35b9C and the only thing I do is I've also tried switching to different version, modifying the code with no luck. In React native I get |
Ok, yeah we need to dig more into this still, sorry you're running into this |
Hi @deontologician. I see a commit in the next branch. Is this something that fixes this issue so that we can get back to working with horizon and react native? |
@jimthedev still waiting for someone to try and see if this fixes the issue for react native too, yes. |
@deontologician Are there any updates yet on supporting React Native? Would like to use Horizon in conjunction with React Native but can't seem to resolve this issue. I tried the latest client from the repo and it resolve the import error but now I am getting this issue: |
I've removed fetch in PR #619 , so it's possible that will fix at least part of the problem (one less polyfill). window.location.search is not part of this issue |
Also having this issue(not using react native) but this boilerplate.
|
Ok, fetch has been completely removed, along with the webpack directive to make it a global. |
I am hooking up my react-native app with the horizon server and I am still having the same issues as @dvassilev. Tried using Using version 1.1.3 |
@FrancisMurillo if I understand correctly, this hasn't been released yet to npm. It is in master and will be released with the 2.0 release. |
Client version: 1.0.2
When using the horizon client in React Native by calling
import Horizon from '@horizon/client';
you get the following error:Unable to resolve module imports?this=>global!exports?global.fetch!isomorphic-fetch from ....
The problem is this line: https://github.com/rethinkdb/horizon/blob/next/client/src/util/fetch.js#L6. I think it is a way to shim modules with webpack. I'm not entirely sure how to fix it? React Native had its own implementation of global.fetch by default, so we should use that instead of a module. Any ideas?
The text was updated successfully, but these errors were encountered: