You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I use native lazy loading for iframes in my HTML files, Penthouse doesn’t create critical CSS for these files. I get a stack trace:
/home/travis/build/Kristinita/SashaTravis/node_modules/penthouse/lib/core.js:342
error: newError('Penthouse timed out after '+timeout/1000+'s. ')^Error: Penthousetimedoutafter30s.atTimeout.<anonymous>(/home/travis/build/Kristinita/SashaTravis/node_modules/penthouse/lib/core.js:342:16)atlistOnTimeout(node:internal/timers:564:17)atprocess.processTimers(node:internal/timers:507:7)
constpenthouse=require('penthouse');constfs=require('fs');penthouse({// [INFO] “url: 'file:///D:/SashaDemoRepositories/SashaTravis/KiraExamplePassed.html',” for my Windowsurl: 'file:///home/travis/build/Kristinita/SashaTravis/KiraExamplePassed.html',cssString: 'body { color: red }'}).then(criticalCss=>{fs.writeFileSync('KiraOutfilePassed.css',criticalCss);});
KiraPenthouseFailed.js:
constpenthouse=require('penthouse');constfs=require('fs');penthouse({// [INFO] “url: 'file:///D:/SashaDemoRepositories/SashaTravis/KiraExampleFailed.html',” for my Windowsurl: 'file:///home/travis/build/Kristinita/SashaTravis/KiraExampleFailed.html',cssString: 'body { color: red }'}).then(criticalCss=>{fs.writeFileSync('KiraOutfileFailed.css',criticalCss);});
- // [INFO] “url: 'file:///D:/SashaDemoRepositories/SashaTravis/KiraExamplePassed.html',” for my Windows- url: 'file:///home/travis/build/Kristinita/SashaTravis/KiraExamplePassed.html',+ // [INFO] “url: 'file:///D:/SashaDemoRepositories/SashaTravis/KiraExampleFailed.html',” for my Windows+ url: 'file:///home/travis/build/Kristinita/SashaTravis/KiraExampleFailed.html',- fs.writeFileSync('KiraOutfilePassed.css', criticalCss);+ fs.writeFileSync('KiraOutfileFailed.css', criticalCss);
Thanks a lot for the detail bug report, and the reproducible test case - I can reproduce the problem.
I will do my best to find time to look into this, but I wouldn't count on myself finding a fix in the near term. My first hunch is that - as you linked to issue #257 - that this is a problem from puppeteer, the version that is currently used. So what I would do next is to try to upgrade the puppeteer version, and see if that fixes the problem.
#257 — possibly related issue
1. Summary
If I use native lazy loading for iframes in my HTML files, Penthouse doesn’t create critical CSS for these files. I get a stack trace:
2. MCVE
This configuration on GitHub, Travis CI build for it.
package.json
:KiraExamplePassed.html
:KiraExampleFailed.html
:KiraPenthousePassed.js
:KiraPenthouseFailed.js
:The part of the
.travis.yml
:3. Behavior
3.1. Desired — KiraPenthousePassed.js
Travis link:
If my iframe at the top of my real HTML page and loads when the page is opened, I don’t get errors when using Penthouse.
3.2. Error — KiraPenthouseFailed.js
Travis link:
Else my iframe is in the middle or end of my real HTML page and loads lazy, I get this stack trace when I use Penthouse.
4. Environment
Operating system:
Node.js v18.9.0
Penthouse 2.3.3
Thanks.
The text was updated successfully, but these errors were encountered: