Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated d.ts file from npm.jsr.io doesn't have Symbol.iterator declaration #886

Open
MellKam opened this issue Jan 8, 2025 · 0 comments

Comments

@MellKam
Copy link

MellKam commented Jan 8, 2025

Hi, I recently published a module on JSR: https://jsr.io/@melkam/circular-buffer. I tried using it with other package managers like pnpm and bun. It works fine overall, but I noticed a problem: my CircularBuffer class doesn't include the [Symbol.iterator]() method in its generated .d.ts file, even though it's defined in the source code.

Here’s my source code:

export class CircularBuffer<T> implements Iterable<T, undefined> {
  // ... other class methods
  [Symbol.iterator](): Iterator<T, undefined> {
    return { ... };
  }
}

But the generated .d.ts file looks like this:

export declare class CircularBuffer<T> implements Iterable<T, undefined> {
  // ... other class methods
  // [Symbol.iterator] is missing :(
}

For some reason, [Symbol.iterator] just disappears in the declaration file. To check it out, you can install my package with a package manager other than Deno and inspect /node_modules/@melkam/circular-buffer/_dist/mod.d.ts.

I also tried creating a sandbox example to demo this issue, but it seems JSR modules can’t be installed in StackBlitz right now.

@github-project-automation github-project-automation bot moved this to Needs Triage in JSR Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Needs Triage
Development

No branches or pull requests

1 participant