Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upReact Native Support? #1740
React Native Support? #1740
Comments
This comment has been minimized.
This comment has been minimized.
|
Are you saying it crashes with that error and all you did was import WebTorrent? You didn't write any other code? |
This comment has been minimized.
This comment has been minimized.
|
Yep, completely fresh install using OS X, WebStorm, Node 10.16.0. installed using:
Then using Yarn I install the WebTorrent package (I've tried installing with both Yarn and npm):
Then in my App.js I import after my ReactNative imports:
There's absolutely no other code related to webtorrent in my project, just a very simple hello world. I'm then running using AndroidTV 9.0 emulator. Here's the stack trace if it's any help: Sorry if I've not explained this well or if there's something obvious here I've missed. I'm a CS student trying to get to grips with React Native. Any help is greatly appreciated!
UPDATE |
This comment has been minimized.
This comment has been minimized.
|
I believe this issue was caused by my updating the Can you update the version of |
This comment has been minimized.
This comment has been minimized.
|
Still getting the same error on 0.107.13. Stack trace still pointing to this same block in the expanded version of webtorrent.min.js line 3752:
|
This comment has been minimized.
This comment has been minimized.
|
Oops, the |
This comment has been minimized.
This comment has been minimized.
|
This is now throwing:
|
This comment has been minimized.
This comment has been minimized.
|
Looks like you might need to include https://github.com/LinusU/react-native-webcrypto to get the subtle crypto API to work in react native? |
This comment has been minimized.
This comment has been minimized.
|
I've added react-native-webcrypto to the project and have linked and imported it right before WebTorrent:
But I'm still getting the same error. Like I said, I'm still trying to build my experience in React Native so I'm not sure if extra steps are needed to get webtorrent.min.js to use the react-native-webcrypto subtle crypto api instead of the broken or absent subtle crypto api? Tomorrow I’m going to look at using rn-nodeify‘s crypto package which I think should work but it seems like serious overkill just to use the subtle crypto API but I’m willing to try anything at this point! Thank you so much for all the help you've provided so far and I really, really hope this will be the last hurdle to overcome and I can get on with my project :) |
This comment has been minimized.
This comment has been minimized.
|
Good luck figuring it out. If any React Native users want to chime in, please go for it. |
This comment has been minimized.
This comment has been minimized.
|
Errors relating to crypto (specifically, getRandomValues) can be fixed using this package: There is now an exception related to this on line 6151: Let me know if there is any other information I can provide.! |
This comment has been minimized.
This comment has been minimized.
|
You'd probably have an easier time figuring this out if you used a debug build instead of the minified one.
Then the debug build will be at |
This comment has been minimized.
This comment has been minimized.
|
Not sure, but this might help you too https://github.com/tradle/rn-nodeify |
Is this module supported by React Native? I've been trying to get it to run all day via the following steps:
~ npm installThen in App.js I do my React imports followed by the webtorrent import:
import WebTorrent from 'webtorrent/webtorrent.min'As soon as I run it over the debugger I get this error:
Cannot create URL for blob!I know this isn't much information to go on but I honestly have no idea why this isn't working. It should be a simple import?