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

waitForRender <timeout> causes invalid selector and DOMException. #46

Open
videki opened this issue Mar 1, 2022 · 2 comments
Open

waitForRender <timeout> causes invalid selector and DOMException. #46

videki opened this issue Mar 1, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@videki
Copy link

videki commented Mar 1, 2022

Running

mr-pdf --initialDocURLs='http://localhost:3000/docs/next' --waitForRender=5000 ....

causes the following error because the parameter is considered to be string in utils at the end in all cases, which expects it to be a selector:

`
Retrieving html from http://localhost:3000/docs/next

Rendering...
Error: Evaluation failed: DOMException: Failed to execute 'querySelector' on 'Document': '5000' is not a valid selector.
at predicate (eval at waitForPredicatePageFunction (:2:21), :6:20)
at eval (eval at waitForPredicatePageFunction (:2:21), :25:7)
at pollMutation (puppeteer_evaluation_script:17:31)
at waitForPredicatePageFunction (puppeteer_evaluation_script:9:18)
at ExecutionContext._evaluateInternal (/Users/.../node_modules/puppeteer/lib/ExecutionContext.js:122:13)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async WaitTask.rerun (/Users/.../node_modules/puppeteer/lib/DOMWorld.js:570:17)
-- ASYNC --
at ExecutionContext. (/Users/.../node_modules/puppeteer/lib/helper.js:111:15)
at WaitTask.rerun (/Users/.../node_modules/puppeteer/lib/DOMWorld.js:570:65)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
-- ASYNC --
at Frame. (/Users/.../node_modules/puppeteer/lib/helper.js:111:15)
at Frame.waitFor (/Users/.../node_modules/puppeteer/lib/FrameManager.js:612:19)
at Page.waitFor (/Users/.../node_modules/puppeteer/lib/Page.js:1113:29)
at Object.generatePDF (/Users/.../node_modules/mr-pdf/lib/utils.js:23:32)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
`

@zebracookie
Copy link

Anyone got a solution for that ? Images load inconsistently on my side and --waitForRender does not work.

Thanks :)

@dannief
Copy link

dannief commented Jan 17, 2023

I am also getting this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants