ReferenceError: Property 'ReadableStream' doesn't exist
sleep9 opened this issue · 3 comments
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`)
@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.
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
it looks like you found the required module in ipfs/helia#435, are you unblocked here?