niieani / puppeteer-intercept-and-modify-requests

The best way to intercept and modify requests done by a Chromium website when instrumented by puppeteer
Apache License 2.0
48 stars 8 forks source link

Protocol error (Fetch.getResponseBody): Can only get response body on requests captured after headers received. #9

Closed Ren232 closed 1 year ago

Ren232 commented 1 year ago

On websites that take longer to load the following error can occur. I managed to patch it up by adding try-catches but it isn't a long term fix.

            error: new Errors_js_1.ProtocolError(),
                   ^

ProtocolError: Protocol error (Fetch.getResponseBody): Can only get response body on requests captured after headers received. at C:\Users\renes\Documents\projects\F1LiveFinder\node_modules\puppeteer-core\lib\cjs\puppeteer\common\Connection.js:329:24 at new Promise () at CDPSessionImpl.send (C:\Users\renes\Documents\projects\F1LiveFinder\node_modules\puppeteer-core\lib\cjs\puppeteer\common\Connection.js:325:16) at RequestInterceptionManager.onRequestPausedEvent (C:\Users\renes\Documents\projects\F1LiveFinder\node_modules\puppeteer-intercept-and-modify-requests\cjs\main.js:65:114)

niieani commented 1 year ago

Is there a way I can reproduce this issue?

Ren232 commented 1 year ago

Thanks for the fast reaction. I got the error by going to a website that has slow response times.

github-actions[bot] commented 1 year ago

:tada: This issue has been resolved in version 1.2.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: