stereobooster / react-snap

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

Navigation Timeout Exceeded with waitUnti #474

Open krzywiecki opened 4 years ago

krzywiecki commented 4 years ago

Bug Report

Hello guys! First of all thanks for react-snap which is a great tool for my needs and beats all the other alternatives I found.

I've been struggling with already known (https://github.com/stereobooster/react-snap/issues/230, https://github.com/stereobooster/react-snap/issues/131) timeout issue which appears after version 1.10.0 due to update in puppeteer. I see it's been a problem already for quite long and it's definitely a problem for many of your users so I'm wondering how effectively we can fix it without waiting for fix in puppeteer.

I've noticed that the timeout error appears quite randomly only on Linux machines while on MacOS it works fine. Since generating snapshots is integrated in my CI/CD which works via Github actions I simply changed runs-on: ubuntu-latest to runs-on: macos-latest and this has fixed the issue for me.

Of course, the above is probably not possible for many of you so I thought of another way of fixing that based on extending react-snap config. My use case is that I generate ~1000 snapshots as pages in my app can be published by users so the platform still grows. And I have to regenerate them quite often. I wouldn't be really a big issue if one of the snapshots wasn't generated and just skipped.

My proposition to fix that would be to repeat snapshot generation if it failed because of timeout error or optionally skip it without exiting the job. In my use case, it would not be a big issue if I skip one or two pages snapshot as I'm generating them frequently anyway.

Please let me know if some of these would be interested for you, then I can raise a PR.