From 990b61fe5fa9805f97d06b61f7af4a624a60fc4d Mon Sep 17 00:00:00 2001 From: David Beckley Date: Tue, 17 Apr 2018 15:54:01 -0700 Subject: [PATCH] Wait for images to load before screenshotting Signed-off-by: David Beckley --- packages/gatsby-transformer-screenshot/lambda/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/gatsby-transformer-screenshot/lambda/index.js b/packages/gatsby-transformer-screenshot/lambda/index.js index 2f100dcce955a..5f753a82bc9f0 100644 --- a/packages/gatsby-transformer-screenshot/lambda/index.js +++ b/packages/gatsby-transformer-screenshot/lambda/index.js @@ -85,6 +85,8 @@ exports.run = async (browser, url, width, height) => { await page.setViewport({ width, height }) await page.goto(url, { waitUntil: [`load`, `networkidle0`] }) + // wait for full-size images to fade in + await page.waitFor(1000); const screenshot = await page.screenshot() const up = await s3PutObject(key, screenshot)