Open sasa130 opened 7 months ago
Apparently it is related to the fact that the Node 18.X runtime (in my case) went from 18.26 to 18.28 and the latter breaks something in the library (at least in my case it worked perfectly until AWS started the function with 18.26). Unfortunately you cannot choose the minor version in the configuration of each lambda.
Potentially related (with fix): https://github.com/Sparticuz/chromium/issues/229#issuecomment-2084587650
Environment
chromium
Version: 122.0.0puppeteer
/puppeteer-core
Version: 22.4.1Expected Behavior
page.setContent executes successfully
Current Behavior
Protocol error (Fetch.getResponseBody): Can only get response body on requests captured after headers received.
is thrown by this line of code:
await page.setContent(htmlString, { waitUntil: 'load', });
Steps to Reproduce
The error occurs in the call to convertToPdf, specifically in page.setContent (since the last log we saw was 'interceptAndResizeImages: success'). The same set of code works for most of the emails we're converting to html string, but for some reason, fails for some emails.
Possible Solution