Closed negamaxi closed 1 year ago
This is annoying but also expected - please see the browser compatibility table on MDN - https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream#browser_compatibility
Only node.js, deno and Firefox support iterating over ReadableStreams as AsyncIterators.
The relevant Chromium bug is here.
This code works in Firefox 115.0 and throws error in Chrome 114.0:
The reason is in this function:
https://github.com/ipfs/js-ipfs-unixfs/blob/47218799b4c28b0a4b4dc5a71b9d981e5d803424/packages/ipfs-unixfs-importer/src/dag-builder/index.ts#L37-L39
It returns
true
in Firefox andfalse
in Chrome forfile.stream()
result (instance ofReadableStream
) passed as value offileObject.content
: