Skip to content

[Bug]: UnknownErrorException: parent.get is not a function #19822

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

Closed
gsamokovarov opened this issue Apr 17, 2025 · 4 comments
Closed

[Bug]: UnknownErrorException: parent.get is not a function #19822

gsamokovarov opened this issue Apr 17, 2025 · 4 comments

Comments

@gsamokovarov
Copy link

Attach (recommended) or Link to PDF file

While rendering a specific document I get the following error. The controls I use in my case seem to work: zoom {in,out,reset}, page controls and print. I can send the document privately.

Image

Web browser and its version

'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36'

Operating system and its version

macOS

PDF.js version

v5.1.91

Is the bug present in the latest PDF.js version?

Yes

Is a browser extension

No

Steps to reproduce the problem

  1. Open specific PDF document. I will send it privately.

What is the expected behavior?

Not raising an error.

What went wrong?

An error while decoding a PDF document.

Link to a viewer

No response

Additional context

No response

@Snuffleupagus
Copy link
Collaborator

Snuffleupagus commented Apr 17, 2025

I can send the document privately.

Sorry, but please note that we need publicly available test-cases to make issues actionable/valid for any contributor.

(Also, please provide error messages as text rather than images.)

@gsamokovarov
Copy link
Author

gsamokovarov commented Apr 17, 2025

I have this happnening in a customer document, I cannot publicly share it, or have the expertise to reproduce the error in another document. I have sent the document privately to @calixteman.

I was able to debug the problem down to StructTreeNode.addPage:

const parent = dict.get("P");
if (!parent || isName(parent.get("Type"), "StructTreeRoot")) {

For this particular document parent.get (at some point) gives us an object of CCITTFaxStream type that doesn't have a get method.

Image

@Snuffleupagus
Copy link
Collaborator

Snuffleupagus commented Apr 20, 2025

Closing, since the PR referenced above is probably the only thing that can be done without a test-case.

@gsamokovarov
Copy link
Author

It is fixed for the documents we were hitting this.

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

No branches or pull requests

2 participants