Skip to content

JSR generated types for @std/async for npm are missing [Symbol.asyncIterator] #6710

Open
@egfx-notifications

Description

@egfx-notifications

Describe the bug

When using @std/async in a NodeJS based project / with npm and TypeScript tsc complains about node_modules/@std/async/_dist/mux_async_iterator.d.ts

Output:

test-jsr-bug> npx tsc --noEmit
node_modules/@std/async/_dist/mux_async_iterator.d.ts:34:26 - error TS2420: Class 'MuxAsyncIterator<T>' incorrectly implements interface 'AsyncIterable<T>'.
  Property '[Symbol.asyncIterator]' is missing in type 'MuxAsyncIterator<T>' but required in type 'AsyncIterable<T>'.

34  */ export declare class MuxAsyncIterator<T> implements AsyncIterable<T> {
                            ~~~~~~~~~~~~~~~~

  node_modules/typescript/lib/lib.es2018.asynciterable.d.ts:38:5
    38     [Symbol.asyncIterator](): AsyncIterator<T, TReturn, TNext>;
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    '[Symbol.asyncIterator]' is declared here.


Found 1 error in node_modules/@std/async/_dist/mux_async_iterator.d.ts:34

The symbol is declared in the .ts source, but missing in the generated .d.ts
I assume this generation happens on JSR?

Steps to Reproduce

Minimal reproduction repo with steps: https://github.com/egfx-notifications/jsr-issue-reproduction

Expected behavior

[Symbol.asyncIterator] is present in mux_async_iterator.d.ts and no TypeScript errors are reported

Environment

  • OS: RHEL 9.5
  • NodeJS version: 22.15.0
  • std version: 1.0.13

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions