-
-
Notifications
You must be signed in to change notification settings - Fork 421
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
pdfjs-dist dependancy issue for setIterator #1164
Comments
See #1137 (comment) --> #1161 (unless another solution is found) |
@shamoon Updating angular to next Major version will leads to lot of complexities. Are you planning something that will be done from this module side. |
I am also using facing the above issue. tried installling child dependency (pdfjs-dist) separately as well. This is a typescript problem. Angular 18 does not support typescript version 5.6.3. Whereas "SetIterator" type has been introduced in Typescript version 5.6.0 onward. Even downgrading ng2-pdf-veiwer should have been solved this issue. But looks like that library has been modified in such a way that it does not work for previous version as well. This is my requrest please fix this ASAP. we facing this problem. The only we are left with is upgrading Angular version to 19. I have tested this in angular version 19 where typescript version 5.6.3 is supported. It is working. but there are warning messages as well. The above dynamic import cannot be analyzed by Vite. Plugin: vite:import-analysis Plugin: vite:import-analysis |
|
In the meantime, there is this workaround: mozilla/pdf.js#18867 (comment)
|
What doesn't work, the PR or the workaround? The workaround would only work (and be needed) in a project with ts < 5.6. Certainly both worked in my testing... The error you just reported suggests you're building with a version of typescript that has it already |
@shamoon both PR and workaround did not work: My configurations are as follows: angular 18 the workaround error message is : Duplicate identifier 'SetIterator'.ts(2300) |
Also, this just isn't true. Your comments lead me to believe your packages are messed up (either the lock file or just the node_modules and you're not doing a clean install). But this note is not possible, older versions of plugins dont get modified somehow, that's literally the point of npm. |
@shamoon after your messasge. I have deleted the package.lock.json file as well it did not work. Error is same SetIterator" type problem. Regarding node_module, yes I have removed it completly and even removed or clean the its caches as well. Yes, my previoous message does not sounds logical for version downgrade but its happing. |
A Stackblitz: https://stackblitz.com/edit/stackblitz-starters-pqzeyp |
I am facing this issue too, it's so weird. I have angular v18.2.0 and I don't want to upgrade to v19. ✘ [ERROR] TS2552: Cannot find name 'SetIterator'. Did you mean 'Iterator'? [plugin angular-compiler]
|
Funny use this lib in production.. xDDD use "ng2-pdf-viewer": "10.2.2", "pdfjs-dist": "4.2.67", "typescript": "~5.4.5", |
Angular 17.3.0 I saw the same issue with SetIterator. // typings.d.ts: |
That is what I said above... #1164 (comment) --> mozilla/pdf.js#18867 (comment)
|
Now it's working! Thanks!!! |
|
The issue is solved with adding typings.d.ts. Thanks @shamoon for the quick help. But please let un know here once the issue is fixed form the module dependency. |
Hi,
I have updated my ng2-pdf-viewer version to the latest which is (10.4.0 and also tried with 10.3.4) but still I see the pdfjs-dist dependency issue.
Issue is listed below. please check.
Error: node_modules/pdfjs-dist/types/web/pdf_viewer.d.ts:175:26 - error TS2552: Cannot find name 'SetIterator'. Did you mean 'Iterator'?
And below are my project dev dependencies.
"devDependencies": {
"@angular-devkit/build-angular": "^18.0.7",
"@angular/cli": "^18.0.7",
"@angular/compiler-cli": "~18.0.6",
"@types/file-saver": "^2.0.5",
"@types/jasmine": "~3.10.0",
"@types/node": "^12.11.1",
"chromium": "~3.0.3",
"husky": "^9.0.11",
"jasmine-core": "~3.10.0",
"karma": "~6.3.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.1.0",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "~1.7.0",
"karma-junit-reporter": "~2.0.1",
"prettier": "^3.2.5",
"pretty-quick": "^4.0.0",
"tslint": "^6.1.3",
"tslint-config-prettier": "^1.18.0",
"typescript": "^5.4.5"
}
The text was updated successfully, but these errors were encountered: