stereobooster / react-snap

👻 Zero-configuration framework-agnostic static prerendering for SPAs
MIT License
5.04k stars 391 forks source link

Puppeteer taking a snapshot of content at a mobile resolution/viewport? #490

Open hdehal opened 3 years ago

hdehal commented 3 years ago

Thanks for your work on react-snap -- it works quite well with minimal effort.

I noticed that on initial page draw, my map component (LeafletJs geo tiles) is preloaded as static content and briefly flashes -- which is fine -- however it 100% appears as it would on mobile device through one of my smaller responsive breakpoints (although I'm loading on a largescreen device). Once the app hydrates, it is 100% fine and operates as normal.

I am assuming this is coming from Puppeteer? Is there a way to adjust the Puppeteer resolution or viewport size, perhaps something like https://stackoverflow.com/questions/52553311/how-to-set-max-viewport-in-puppeteer ?

Thanks!