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? #435

Closed
sleep9 opened this issue Feb 14, 2024 · 3 comments
Closed

React-native support? #435

sleep9 opened this issue Feb 14, 2024 · 3 comments

Comments

@sleep9
Copy link

sleep9 commented Feb 14, 2024

const node = await createNode(relayAddrs,pid); // libp2p
const datastore = new MemoryDatastore()
const ipfs = await createHelia({ datastore,libp2p:node }) 

Getting the following error when trying to create an instance of helia.
"Your javascript code tried to access a native module that doesnt exist in this development client"

Maybe someone can reproduce this error. Not sure what needs to be polyfilled or what native library is needed.
Tried rm -rf ./node_modules, npm install, pod deintegrate && pod install but no luck.
Tried "postinstall": "rn-nodeify --install events --hack" no luck.

@achingbrain
Copy link
Member

There are some polyfills/config that need to be set up to modernise the React Native environment - it's documented here - https://github.com/ipfs-shipyard/js-libp2p-react-native

Could you try building from that project, then adding Helia to it to see what extra stuff is needed?

@sleep9
Copy link
Author

sleep9 commented Feb 15, 2024

I started from a git clone of that repository. Here is the error, I thought it might be events but I was wrong.

Screenshot 2024-02-15 at 09 33 22

@sleep9
Copy link
Author

sleep9 commented Mar 8, 2024

The native module required was react-native-webrtc.

@sleep9 sleep9 closed this as completed Mar 8, 2024
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