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

[Bug]: Cannot find name 'SetIterator' Did you mean 'Iterator'? #18867

Closed
umaisa786 opened this issue Oct 7, 2024 · 11 comments
Closed

[Bug]: Cannot find name 'SetIterator' Did you mean 'Iterator'? #18867

umaisa786 opened this issue Oct 7, 2024 · 11 comments

Comments

@umaisa786
Copy link

Attach (recommended) or Link to PDF file

Jenkins build failing at cd

Web browser and its version

Latest version

Operating system and its version

Latest version

PDF.js version

2.11.338

Is the bug present in the latest PDF.js version?

Yes

Is a browser extension

No

Steps to reproduce the problem

SetIterator cannot find name did you mean iterator in node_modules/pdfjs-dist/types/web/pdf viewer.d.ts

What is the expected behavior?

Need to resolve that iterator issue

What went wrong?

Need to resolve that iterator issue

Link to a viewer

No response

Additional context

No response

@Snuffleupagus
Copy link
Collaborator

Attach (recommended) or Link to PDF file

Jenkins build failing at cd

Sorry, but that's not an environment that we know anything about and thus we cannot provide any help/support for it unfortunately.

PDF.js version

2.11.338

That version is many years out of date, and completely unsupported now.

Steps to reproduce the problem

SetIterator cannot find name did you mean iterator in node_modules/pdfjs-dist/types/web/pdf viewer.d.ts

This sounds like a TypeScript issue, rather than PDF.js one; please ensure that you're using the latest TypeScript version.


In general this issue is unfortunately missing too much information in order to be actionable; please also see https://github.com/mozilla/pdf.js/blob/master/.github/CONTRIBUTING.md (emphasis mine):

If you are developing a custom solution, first check the examples at https://github.com/mozilla/pdf.js#learning and search existing issues. If this does not help, please prepare a short well-documented example that demonstrates the problem and make it accessible online on your website, JS Bin, GitHub, etc. before opening a new issue or contacting us in the Matrix room -- keep in mind that just code snippets won't help us troubleshoot the problem.

@Snuffleupagus Snuffleupagus closed this as not planned Won't fix, can't repro, duplicate, stale Oct 7, 2024
@nb-midwestern
Copy link

I Just recently started getting this error as well. If you find out the cause please share!

@nicolo-ribaudo
Copy link
Contributor

You need to update to TypeScript 5.6.

@nb-midwestern
Copy link

ooof, angular prevents me from going up to 5.6 😞

@RoyHP
Copy link

RoyHP commented Oct 7, 2024

Same problem here, can't update typescript due to Angular

@calixteman
Copy link
Contributor

@nb-midwestern
Copy link

nb-midwestern commented Oct 7, 2024

That must be for v19. The current version 18 doesn't support it
https://angular.dev/reference/versions
Here is package for Latest angular v18.2.7 https://github.com/angular/angular/blob/46b088a245d19e446624f095d69560b0404270f5/package.json#L150

@nicolo-ribaudo
Copy link
Contributor

You can create a .d.ts file with no imports/exports (so that TS considers it to be global), and declare a SetIterator alias for Iterator.

@sdagkas
Copy link

sdagkas commented Dec 4, 2024

You can create a .d.ts file with no imports/exports (so that TS considers it to be global), and declare a SetIterator alias for Iterator.

Any guides on how to do that? Facing the same issue using Angular 17 and can't upgrade.

@shamoon
Copy link

shamoon commented Dec 6, 2024

You can create a .d.ts file with no imports/exports (so that TS considers it to be global), and declare a SetIterator alias for Iterator.

Any guides on how to do that? Facing the same issue using Angular 17 and can't upgrade.

I think:

  1. Add e.g. "typings": "./src/typings.d.ts" to your package.json file
  2. Create the file src/typings.d.ts containing only: type SetIterator<T> = Iterator<T>;

@sdagkas
Copy link

sdagkas commented Dec 6, 2024

You can create a .d.ts file with no imports/exports (so that TS considers it to be global), and declare a SetIterator alias for Iterator.

Any guides on how to do that? Facing the same issue using Angular 17 and can't upgrade.

I think:

  1. Add e.g. "typings": "./src/typings.d.ts" to your package.json file
  2. Create the file src/typings.d.ts containing only: type SetIterator<T> = Iterator<T>;

That worked, you're a life saver!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants