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 support (feature request) #906

Closed
sigurdsvela opened this issue Sep 8, 2016 · 7 comments
Closed

React Native support (feature request) #906

sigurdsvela opened this issue Sep 8, 2016 · 7 comments

Comments

@sigurdsvela
Copy link

@sigurdsvela sigurdsvela commented Sep 8, 2016

Has there been any thought to react native support?
I'm fairly new to it, so I don't really know what's required to make it work, or how high effort it is,
but it would be great.

@DiegoRBaquero

This comment has been minimized.

Copy link
Member

@DiegoRBaquero DiegoRBaquero commented Sep 8, 2016

Each platform would have to support WebRTC. You can just throw in webtorrent if it does.

@yciabaud

This comment has been minimized.

Copy link
Contributor

@yciabaud yciabaud commented Sep 9, 2016

You can try using the react native webrtc module and let us know how it does!

@sigurdsvela

This comment has been minimized.

Copy link
Author

@sigurdsvela sigurdsvela commented Sep 9, 2016

Cool, I'll try that. Will report as soon as I'v had the time to check it out.

@sigurdsvela

This comment has been minimized.

Copy link
Author

@sigurdsvela sigurdsvela commented Sep 9, 2016

Ok, so I have at least figured one of the problems,
When trying to import webtorrent in react native i get an Unable to resolve module 'WebTorrent' error. I tried removing everything in webtorrent/index.js and only leave module.exports = {}. Which worked. Surprisingly.

So I added in removed and added lines until I was left only with:

/* global FileList */

module.exports = {}

var Buffer = require('safe-buffer').Buffer

which threw Unable to resolve module 'safe-buffer'

Looking in the safe-buffer/index.js file, I saw that it was trying to import 'buffer', which is not a dependency of safe-buffer(or anything else, i guess), and therefor actually was not resolvable. Simply installing 'buffer' fixed the issue. (not the original one, just the Unable to resolve module 'safe-buffer' one)

So it seems that when react is trying to module A that tries to import some module B that does not exists, it throws an error saying that it can not fine module A.
This seems to be a bug in react native's dev tools, so I'm filing an issue there.

My guess is that one or several of the dependencies of webtorrent(or one of it's dependencies and so on) has an unresolvable dependency.

@yciabaud

This comment has been minimized.

Copy link
Contributor

@yciabaud yciabaud commented Sep 9, 2016

Oh you webtorrent is a node project, you have to use browserify or the javascript-only package (webtorrent.min.js) to use it in a non-node environment.

@sigurdsvela

This comment has been minimized.

Copy link
Author

@sigurdsvela sigurdsvela commented Sep 9, 2016

Ah, sorry. Should have realised. Thanks!

@feross feross closed this Oct 5, 2016
@Uthpala

This comment has been minimized.

Copy link

@Uthpala Uthpala commented Oct 5, 2017

@sigurdsvela can you give me a example on how to use webtorrent with react native. What steps you took.

@lock lock bot locked as resolved and limited conversation to collaborators May 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.