It’s been a while since I’ve used Gatsby Cloud Preview for reviewing my sites. I recently ran into an issue that caught me a bit off guard. My site was working flawlessly on my local setup using gatsby develop. However, as soon as I pushed my site to Gatsby Cloud it built but then loaded a white screen on my SSR pages. I checked the logs and there weren’t any errors, hmmm… 🤔.
Through some debugging (and it was also confirmed on a Gatsby webinar), I found out that Gatsby Cloud Preview is no longer powered by the gatsby develop command but an optimised version of gatsby build and gatsby serve.When I ran gatsby build && gatsby serve I was able to see there were some issues with my SSR pages needing the window when being compiled and because the page was being SSR’d the window wasn’t available.
More on that hereIf you’re using Gatsby Cloud and notice odd behaviours that may be why.