hermes icon indicating copy to clipboard operation
hermes copied to clipboard

Hermes async iterators support

Open amigo70707 opened this issue 10 months ago • 1 comments

I have a file stream that I would like to iterate:

   for await (const chunk of fileStream) {
          console.log(`Received chunk of size ${chunk.length}: ${chunk}`);        
    }

However, I get the following error:

Object is not async iterable

Does hermes support async iterators?

I use:

"react-native": "0.83.1",
"react": "19.2.1",

amigo70707 avatar Jan 21 '26 14:01 amigo70707

This is not an error message generated by Hermes. In React Native the source code is transformed with Babel before it gets to Hermes. Specifically, async generators are transpiled. You can examine the actual generated source that runs.

The error itself does not seem to indicate lack of support for async generators but rather that Symbol.asyncIterator is not present in the object.

tmikov avatar Jan 21 '26 18:01 tmikov