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

Iframe with bad src causing timeouts since version 1.4.0 #257

Closed
leicht-io opened this issue Apr 6, 2018 · 7 comments
Closed

Iframe with bad src causing timeouts since version 1.4.0 #257

leicht-io opened this issue Apr 6, 2018 · 7 comments

Comments

@leicht-io
Copy link

Hi!

I am getting the following error since version 1.4. It isn't a problem in version 1.3.0.

CRITICAL CSS ERROR Error: Penthouse timed out after 300s. 
    at Timeout.<anonymous> (...\node_modules\penthouse\lib\core.js:250:20)
    at ontimeout (timers.js:466:11)
    at tryOnTimeout (timers.js:304:5)
    at Timer.listOnTimeout (timers.js:267:5)

My config looks like this:

penthouse({
        css: './domain.dk/' + hash + '.min.css',
        url: page,
        width: 1920,
        height: 1200,
        renderWaitTime: 3500,
        timeout: 300000,
        strict: false, 
        blockJSRequests: false,
        skipErrors: false,
        forceInclude: genericForceInclude.concat(forceInclude),
    }).then(criticalCss => {
        callback(criticalCss, page);
    }).catch(err => {
        console.log("CRITICAL CSS ERROR", err);
    });
@pocketjoso
Copy link
Owner

Hi, this should be a problem specifically for your website - can you confirm that it works for a completely different url? Can you please share a publicly accessible url that you have this problem with that I can debug?

If you have this problem for any website you test, then it's something about your environment. If so please share your OS, node version, anything else you think is relevant.

Cheers

@leicht-io
Copy link
Author

Hi again!

Well it seems to be a resource problem. I am generating critical CSS for a lot of urls (>25) without any queue system. I will try to implement this and return.

@leicht-io
Copy link
Author

So i was too quick but i managed to fix the error.

The error appears when i have an iframe in the following format:

  <iframe style="width:100%" width="560" height="400" id="youtube"
                            src="?rel=0&amp;controls=1&amp;showinfo=0"
                            frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>

But changning the src to a valid URL everything works as expected.

  <iframe style="width:100%" width="560" height="400" id="youtube"
                            src="https://google.com?rel=0&amp;controls=1&amp;showinfo=0"
                            frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>

Btw. i am using Node v9.7.0.

@pocketjoso
Copy link
Owner

Interesting, I will try to reproduce.

@pocketjoso pocketjoso changed the title Getting timeouts since version 1.4.0 Iframe with bad src causing timeouts since version 1.4.0 Apr 29, 2018
@pocketjoso
Copy link
Owner

pocketjoso commented Apr 29, 2018

I can reproduce, any page with that iframe never loads. Indeed this worked before, it broke when Penthouse upgraded to Puppeteer@1.0.0. I'm guessing your iframe src is not found and how Puppeteer now works it never resolves the Page.load promise.

Puppeteer has changed a bit since the 1.0.0 version, but Penthouse has been blocked from upgrading. In the next release however an upgrade should be possible, so I'll come back to revisit this then to see if this issue can be resolved.

@pocketjoso
Copy link
Owner

Looks like this was indeed resolved with the latest Puppeteer version, now available in latest penthouse (1.4.5), via #261

@pocketjoso
Copy link
Owner

If you test and somehow this fix does not work for you, please re-open the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants