denoland / denoland/std

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

Open
#6,710 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
3.6k
Forks
681
PR merge metrics
No merged PRs in 30d

Description

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

34 */ export declare class MuxAsyncIterator implements AsyncIterable {
~~~~~~~~~~~~~~~~

node_modules/typescript/lib/lib.es2018.asynciterable.d.ts:38:5
38 [Symbol.asyncIterator](): AsyncIterator;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'[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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.