-
-
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
Cannot find name 'WeakKey'. version 10.2.2 #1101
Comments
any update on this, I got the same issue after updating to latest version for security update |
Same here...need to update this package but can't because of this error. |
I have the exact same problem. Any help appreciated. |
using below libraries for viewing pdf in my application, but throwing below error. ------------------------------------Error------------------------------------------------------------------------------------------------ text_layer_builder.d.ts file : line number 41 :textDivProperties: WeakMap<WeakKey, any>;
|
Same problem here, in my case, using angular 16.2.12 :
The only solution that i have found to use it with angular 16 is downgrade to 10.0.0 and remove pdfjs-dist from package.json |
On an angular 16 project, try adding;
to your tsconfig.json file. This has fixed the issue for me on my angular 16 project. On my Angular 17 project I found this was not necessary. I noticed in this commit 15cba0d that the same was added to this project. |
Si bien funciona utilizar
no me parece la solucion correcta. |
Same here. BUT you do not want to disable the lib checking. pdfjs-dist anyway has a lot of problems, npm complains abut a high severity issue in it for a long time. It would be best to get rid of that dependency altogether in this project. |
Same problem here |
Why is disabling lib checking not a good idea? Can you provide some context? I'm having this same error and have been looking for a solution for a while. I can make it work if I edit the affected line and change "WeakMap" for "any", but I have no idea what this could be breaking. And besides, it seems to not be a very practical solution because I would need to do this edit every time I do an npm install from scratch. |
@mgustran provided the most accurate answer. Using the 'skipLibCheck' option didn't seem like the right approach. I found it more effective to downgrade the version, remove pdfjs-dist, and that resolved the issue. |
Upgrading to Angular 17 solved it for me. |
Bug Report or Feature Request (mark with an
x
)After updating from 9.1.5 to 10.2.2 I got error -
Error: node_modules/pdfjs-dist/types/web/text_layer_builder.d.ts:41:32 - error TS2304: Cannot find name 'WeakKey'.
41 textDivProperties: WeakMap<WeakKey, any>;
My angular version 16.2.12
The text was updated successfully, but these errors were encountered: