Skip to content

Inconsistent behaviour of isAsyncIterable function between Chrome and Firefox #354

@negamaxi

Description

@negamaxi

This code works in Firefox 115.0 and throws error in Chrome 114.0:

const fileObject = Array.from(files).map((file) => ({
  path: file.name,
  content: file.stream(),
}));

for await (const cid of heliaFS.addAll(fileObject)) {
  console.log(cid);
}

The reason is in this function:

function isAsyncIterable (thing: any): thing is AsyncIterable<any> {
return Symbol.asyncIterator in thing
}

It returns true in Firefox and false in Chrome for file.stream() result (instance of ReadableStream) passed as value of fileObject.content:

изображение

изображение

Metadata

Metadata

Assignees

No one assigned

    Labels

    need/triageNeeds initial labeling and prioritization

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions