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

Cannot find name 'WeakKey'. version 10.2.2 #1101

Open
diveshdobal opened this issue May 30, 2024 · 8 comments
Open

Cannot find name 'WeakKey'. version 10.2.2 #1101

diveshdobal opened this issue May 30, 2024 · 8 comments

Comments

@diveshdobal
Copy link

Bug Report or Feature Request (mark with an x)
- [ ] Regression (a behavior that used to work and stopped working in a new release)
- [ ] Bug report -> please search issues before submitting
- [ ] Feature request
- [ ] Documentation issue or request

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

@Adhikaripr
Copy link

any update on this, I got the same issue after updating to latest version for security update

@evo-ksalter
Copy link

Same here...need to update this package but can't because of this error.

@mibadim
Copy link

mibadim commented Jun 5, 2024

I have the exact same problem. Any help appreciated.

@SurekhaKarthik
Copy link

using below libraries for viewing pdf in my application, but throwing below error.
"ng2-pdf-viewer": "^10.2.1",
"pdfjs-dist": "^4.3.136"

------------------------------------Error------------------------------------------------------------------------------------------------
Error: node_modules/ng2-pdf-viewer/node_modules/pdfjs-dist/types/web/text_layer_builder.d.ts:41:32 - error TS2304: Cannot find name 'WeakKey'.

text_layer_builder.d.ts file : line number 41 :textDivProperties: WeakMap<WeakKey, any>;


** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **

@mgustran
Copy link

Same problem here, in my case, using angular 16.2.12 :

  • error appears in every version since 10.1.0
  • used many ng2-pdf-viewer and pdfjs-dist version combinations does not seem to work either

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

@JRobinsIken
Copy link

On an angular 16 project, try adding;

"skipLibCheck": true,

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.

@Nicolas-Aguila
Copy link

Si bien funciona utilizar

"skipLibCheck": true

no me parece la solucion correcta.

@pkunszt
Copy link

pkunszt commented Jun 28, 2024

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.

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

No branches or pull requests

9 participants