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

fivefilters\Readability\Nodes\DOM\DOMNodeList::add(): Argument #1 ($node) must be of type #33

Closed
liorphp opened this issue Dec 15, 2024 · 3 comments

Comments

@liorphp
Copy link

liorphp commented Dec 15, 2024

Hello.
I am getting this Unhandled error:

fivefilters\Readability\Nodes\DOM\DOMNodeList::add(): Argument #1 ($node) must be of type fivefilters\Readability\Nodes\DOM\DOMNode|fivefilters\Readability\Nodes\DOM\DOMElement|fivefilters\Readability\Nodes\DOM\DOMText|fivefilters\Readability\Nodes\DOM\DOMComment, fivefilters\Readability\Nodes\DOM\DOMProcessingInstruction given, called in /var/www/.../public_html/VendorPhp/fivefilters/readability.php/src/Nodes/NodeUtility.php on line 161

How can I resolve this?

@fivefilters
Copy link
Owner

Thank you, we'll have a fix soon. If you're able to provide the HTML that caused this, please attach it or link to it so we can test it against the rest of the code too.

@jormeijer
Copy link

jormeijer commented Jan 14, 2025

We are experiencing this error a lot as well.

DOMProcessingInstruction represents tags like:

<?xml-stylsheet ... ?>
<?php ... ?>

You can find, and remove, all processing instructions using xpath:

//processing-instruction()

@fivefilters
Copy link
Owner

Thanks! This should be fixed in version 3.3.1. Let us know if you notice any other issues.

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

3 participants