I'm attempting to integrate the newest version of Puppeteer (21.3.8) for generating PDFs from HTML/CSS in my React application. The challenge I'm facing involves certain HTML/CSS elements behaving improperly with tables in 'printing mode' (using WIN+P or CMD+P), such as incorrect page breaks.
While testing with Puppeteer version 21.3.8
, I encounter the following error when running tests that previously functioned with older versions (less than 19.4.0):
Unable to locate module 'puppeteer-core/internal/puppeteer-core.js' in 'puppeteer.js'
My configurations include Jest version: jest: ^24.9.0
along with React Testing Library!
I am hesitant to downgrade Puppeteer, as this would disrupt my PDF generation capabilities. If anyone has potential solutions or recommendations, I would greatly appreciate your help. Thank you! :)
Here’s what I have attempted so far:
Downgraded Puppeteer to version 18.1.0, which resolved the tests but broke functionality.
Installed versions between 18.1.0 and 21.3.8, leading to a situation where either the functionality worked or the tests passed, but not both.
Experimented with packages such as
puppeteer-extra
and adjustedexecutablePath()
, but none of these actions yielded success.