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
ReferenceError: window is not defined #1719
Comments
The message |
Hi, i'd like to report that i get the same error with a single specific file (pdf viewer version 16.2.16). [Warning: getOperatorList - ignoring XObject: "ReferenceError: window is not defined".](pdf.worker-3.4.493.min.js:22 Warning: getOperatorList - ignoring XObject: "ReferenceError: window is not defined".) Unfortunately I can't share the file since it has confidential info inside. |
No, I don't think there's any specific configuration. You can look it up yourself: https://github.com/stephanrauh/ngx-extended-pdf-viewer/tree/main/projects/ngx-extended-pdf-viewer/schematics/ng-add. All the magic of |
Dear Stephan, Thank you very much for your fast answer and sorry for the delay to come back to you. As for Rodolfo, the file causing the problem are confidential, and we can therefore not share them with you. Nevertheless, we could observe that the problematic files had been created by a scanner named "KONICA MINOLTA bizhub C458", if this information can be of any help. We unfortunately do not have access to this scanner to produce a non-confidential example file. |
Hi @stephanrauh, I am facing the same issue. Angular: 15.2.0
I am not allowed to share the original file so I generated a sample PDF with
Update: |
@sudilshr The original problem was the "window is not defined" message. I don't think that's your issue, or is it? Server-side rendering shouldn't load the pdf.worker-*.js file at all. The flag Does setting the flag to |
This issue is happening to us too, it completely jumbles/breaks (potentially without the user being able to realize it) the rendering of the PDFs. I tried the flag you mentioned above with true and false. Neither one helps fix the issue. I have isolated the rendering issue to starting in v16.2.4 as it does not occur in v16.2.3. We have to downgrade back to v16.2.3 to avoid the issue. I would consider this issue a major bug as it silently fails to render PDFs that would previously be rendered by this library. Anyone upgrading can run into this issue and not even realize it. The warning message being discussed here(getOperatorList - ignoring XObject: "ReferenceError: window is not defined) might just be a side effect or inconsequential to this rendering issue; but this warning does not show up in v16.2.3 where the bug does not occur. Edit: forgot to mention, I am on normal version - NOT bleeding edge. |
@stephanrauh - I was not aware Stackblitz url I shared was doing server side rendering. My original project is browser side rendering though. I log the original error on the console and the error is originating from
AFAIK |
… in the worker thread
… in the worker thread
Right you are! During the last couple of weeks, I worked a lot to support server-side rendering, so I missed the real cause of the issue. It's good that you, @sudilshr, mentioned the web worker. I've introduced the bug accidentally when implementing #1659. And kudos for providing me with a test PDF. I didn't have a file to test this particular feature yet, so your file comes in handy! Your bugfix has landed with version 17.0.0-alpha.1. Enjoy! |
Oops. I've announced your bug fix but somehow I've forgotten to publish the new version. Now it's there. This time for real! |
Hello,
Describe the bug
The following warning appears when displaying some documents:
Warning: getOperatorList - ignoring XObject: "ReferenceError: window is not defined".
In that case, most elements of the pdf are missing (e.g. the text and some images).
Version info
Version 16.X.X
The bug seems not to happen in previous versions. We tested on version 15.
Desktop (please complete the following information):
Chrome. We also tested on Safari and the bug does not seem to appear there.
It seems that the bug has already been fixed in version 11.0.0-alpha.12 #1059.
Thank you
The text was updated successfully, but these errors were encountered: