You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- [ ] Regression (a behavior that used to work and stopped working in a new release)
- [ x] Bug report -> please search issues before submitting
- [ ] Feature request
- [ ] Documentation issue or request
Description
I'm getting the error 'Uncaught TypeError: Promise.withResolvers is not a function' when opening a PDF. I'm using Angular 18 in combination with ng2-pdf-viewer 10.3.4.
Not sure if I should raise the issue here, since the error is thrown from the pdf.worker.min.mjs file, but I'm using the PDF worker file locally (application doesn't have internet access) from the installed pdfjs-dist library (v4.6.82) like this:
This has worked for all older versions, but since the upgrade to 10.3 it throws the error above.
What I can find about this error is that it has to do with the node version and that the .withResolvers() is only available with node >v22. I'm using node v20.18.1, which is supported by Angular. Shouldn't this library support all node versions Angular is support as well?
I also see that v10.4.0 is breaking on Angular 18 because of the typescript version Angular 18 is depending on (setIterator error -> #1164). These are breaking changes inside minor upgrades of the library.
Is it an idea to create versions of this library based on the Angular version it is tested/built with?
Workaround
Right now if I downgrade to ng2-pdf-viewer ~10.2.0 it works, this version is using pdfjs-dist 3.11.174 where the .withResolvers() is not yet implemented. This is implemented from version 4.1.392.
The text was updated successfully, but these errors were encountered:
I suspect this is an issue on your end with dependencies, perhaps not having a clean package lock kind of thing. This issue was 'polyfilled' in #1128 (basically the whole point of that PR was to allow upgrading pdfjs that way).
I think the issue lays with the browser version used on the system of the application. I've tried to isolate the issue on a different machine (with the latest version of Chrome) and I have no issues using the library as described, so this is indeed a non-issue and can be closed.
Bug Report or Feature Request (mark with an
x
)Description
I'm getting the error 'Uncaught TypeError: Promise.withResolvers is not a function' when opening a PDF. I'm using Angular 18 in combination with ng2-pdf-viewer 10.3.4.
Not sure if I should raise the issue here, since the error is thrown from the pdf.worker.min.mjs file, but I'm using the PDF worker file locally (application doesn't have internet access) from the installed pdfjs-dist library (v4.6.82) like this:
And then inside the component where I use the pdf-viewer:
This has worked for all older versions, but since the upgrade to 10.3 it throws the error above.
What I can find about this error is that it has to do with the node version and that the
.withResolvers()
is only available with node >v22. I'm using node v20.18.1, which is supported by Angular. Shouldn't this library support all node versions Angular is support as well?I also see that v10.4.0 is breaking on Angular 18 because of the typescript version Angular 18 is depending on (setIterator error -> #1164). These are breaking changes inside minor upgrades of the library.
Is it an idea to create versions of this library based on the Angular version it is tested/built with?
Workaround
Right now if I downgrade to ng2-pdf-viewer ~10.2.0 it works, this version is using pdfjs-dist 3.11.174 where the
.withResolvers()
is not yet implemented. This is implemented from version 4.1.392.The text was updated successfully, but these errors were encountered: