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

find() throws "Maximum call stack size exceeded" error #1316

Closed
dtto86 opened this issue Apr 1, 2023 · 2 comments · Fixed by #1349
Closed

find() throws "Maximum call stack size exceeded" error #1316

dtto86 opened this issue Apr 1, 2023 · 2 comments · Fixed by #1349

Comments

@dtto86
Copy link

dtto86 commented Apr 1, 2023

We are using cheerio npm package version ^1.0.0-rc.12 in our application to parse xml content. cheerio internally uses domutils version ^3.0.1.

When we tried to parse specific xml content using load() function of cheerio, load() function then internally calls find() of domutils where we observed following exception

RangeError: Maximum call stack size exceeded
    at Object.get [as isTag] (/home/xyz/cheerio-poc/node_modules/domhandler/lib/index.js:6:47)
    at Object.get [as isTag] (/home/xyz/cheerio-poc/node_modules/domutils/lib/index.js:27:100)
    at /home/xyz/cheerio-poc/node_modules/cheerio-select/lib/index.js:293:60
    at find (/home/xyz/cheerio-poc/node_modules/domutils/lib/querying.js:37:13)
    at find (/home/xyz/cheerio-poc/node_modules/domutils/lib/querying.js:43:28)
    at find (/home/xyz/cheerio-poc/node_modules/domutils/lib/querying.js:43:28)
    at find (/home/xyz/cheerio-poc/node_modules/domutils/lib/querying.js:43:28)
    at find (/home/xyz/cheerio-poc/node_modules/domutils/lib/querying.js:43:28)
    at find (/home/xyz/cheerio-poc/node_modules/domutils/lib/querying.js:43:28)
    at find (/home/xyz/cheerio-poc/node_modules/domutils/lib/querying.js:43:28)

Attaching sample code for your reference.
cheerio-poc.zip

@dtto86
Copy link
Author

dtto86 commented Apr 24, 2023

@fb55

Did you get a chance to look into this issue?
Let me know if you need any info from my end.

Thanks

@fb55
Copy link
Owner

fb55 commented Apr 24, 2023

There is already a PR for this: #1281

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

Successfully merging a pull request may close this issue.

2 participants