GithubHelp home page GithubHelp logo

Comments (5)

neocotic avatar neocotic commented on May 26, 2024 2

Ah sorry, I didn't see the distinction between browser instance startup timeout and page navigation timeout. You're right that this isn't currently supported via puppeteer options, however, I'm still a bit curious as to why it should ever timeout after 30 seconds. Are the SVGs you're rendering containing remotely hosted resources (e.g. images, fonts)?

If we were to disable the page navigation timeout, I think it would need to be done on a opt-in basis as I feel like this is implementation detail for puppeteer itself which I'd like to keep out as much as possible.

What I might consider is splitting the existing puppeteer options to be passed down as follows:

This should be able to offer greater control for those like yourself that need it and then you could simply do the following:

const { createConverter } = require('convert-svg-to-png');
await this.converter.convertFile(sourcePath, { puppeteerPageGoto: { timeout: 0 }});

from convert-svg.

neocotic avatar neocotic commented on May 26, 2024

@lietusme Thanks for raising this issue. Is this solution not already achievable by simply using the puppeteer options (e.g. {timeout:0})?

I'm a bit reluctant to disable the timeout all together as I'm not sure that this would be desirable for all implementations. I can imagine most systems wouldn't want to wait more than that default maximum of 30 seconds.

from convert-svg.

lietusme avatar lietusme commented on May 26, 2024

I could not find a way to globally set timeout for puppeteer and only timeout settings seem to be available on page objects only.

I'm not sure how to pass/access puppeteer from converter using this as well:

const { createConverter } = require('convert-svg-to-png');
await this.converter.convertFile(sourcePath, options);

Any hints?

P.S. setting timeout to 1 ms is good way to test if it works, as it starts to fail randomly with same error.

from convert-svg.

lietusme avatar lietusme commented on May 26, 2024

Yes, such customization would work well for my case:
{ puppeteerPageGoto: { timeout: 0 }}

Any estimate when new NPM package version would go out with puppeteer options added?

Regarding SVG that times out - no external resources, 1.4KB size, so not sure what causes it. It is reproduced on remote build machines (MacOS) used by multiple teams so that may be just be result of their slowness or random lags.

from convert-svg.

lietusme avatar lietusme commented on May 26, 2024

For now I worked around this by catching exception and retrying few times before failing.

from convert-svg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.