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

ReferenceError: Property 'ReadableStream' doesn't exist #7

Closed
sleep9 opened this issue Mar 2, 2024 · 3 comments
Closed

ReferenceError: Property 'ReadableStream' doesn't exist #7

sleep9 opened this issue Mar 2, 2024 · 3 comments

Comments

@sleep9
Copy link

sleep9 commented Mar 2, 2024

Hello, just testing this with React-native and getting the following promise rejection...
ReferenceError: Property 'ReadableStream' doesn't exist
Reproducible by the following code
const response = await verifiedFetch(`ipfs://bafybeihkoviema7g3gxyt6la7vd5ho32ictqbilu3wnlo3rs7ewhnp7lly`)

@SgtPooki
Copy link
Member

SgtPooki commented Mar 2, 2024

@sleep9 hey! If react native doesn't provide a polyfill for native web APIs, you will likely need to add a polyfill using your bundler.

it looks like https://www.npmjs.com/package/react-native-polyfill-globals mentions some existing issues for this:

ReadableStream is not supported and, by extension, Response.body is not implemented. Related discussions:

https://www.npmjs.com/package/web-streams-polyfill seems like a popular solution that may help out as well.

NOTE: I do not have deep experience with either of the above mentioned packages and this is not an endorsement.


Do you have an example repo we can use to reproduce this? Making sure we have basic instructions for getting react-native apps working would be great.

@sleep9
Copy link
Author

sleep9 commented Mar 3, 2024

My project is a git clone of the following repository.
https://github.com/ipfs-shipyard/js-libp2p-react-native
Updated to hermes and moved to typescript... Having problems trying to implement those polyfills.
See also this if possible, as these problems might be linked.
ipfs/helia#435

@SgtPooki
Copy link
Member

it looks like you found the required module in ipfs/helia#435, are you unblocked here?

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