Comments (5)
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:
puppeteerLaunch
- options passed topuppeteer.launch
(i.e. https://github.com/puppeteer/puppeteer/blob/v1.10.0/docs/api.md#puppeteerlaunchoptions)puppeteerPageGoto
- options passed topage.goto
(i.e. https://github.com/puppeteer/puppeteer/blob/v1.10.0/docs/api.md#pagegotourl-options)puppeteer
- an alias forpuppeteerLaunch
for backwards compatibility
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.
@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.
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.
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.
For now I worked around this by catching exception and retrying few times before failing.
from convert-svg.
Related Issues (20)
- Support node 16 (update puppeteer) HOT 1
- The Edge Runtime support
- puppeteer params.width and params.height error
- chromium dependency HOT 1
- Arabic characters displayed properly with small svg but not with large one HOT 1
- Support macOS with M1 HOT 3
- Can't run in loop quickly, fails to open chrome eventually HOT 3
- Remote Code Injection vulnerable HOT 11
- Remote Code Injection vulnerable HOT 6
- Remote Code Injection vulnerable HOT 3
- svg:first
- How to disable the sandbox with --no-sandbox? HOT 3
- v0.6.0 fails to convert mermaid SVGs properly
- Typescript support
- 0.6.0 produces dimmer renders than 0.5.0
- Failed converting when doing many in parallel HOT 1
- Fails to convert svg that contains emoji in a <text> tag
- convert-svg-to-png does not process extra parameters in CLI HOT 1
- Doesn't work in Docker Container (convert-svg-to-png) HOT 1
- Puppeteer options setup through CLI won't apply!
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from convert-svg.