diff --git a/functions/customer-og.js b/functions/customer-og.js
deleted file mode 100644
index 4afe2b1a6..000000000
--- a/functions/customer-og.js
+++ /dev/null
@@ -1,152 +0,0 @@
-/* eslint-disable @typescript-eslint/no-var-requires */
-const chromium = require('chrome-aws-lambda')
-
-exports.handler = async () => {
- const browser = await chromium.puppeteer.launch({
- args: chromium.args,
- executablePath: process.env.NETLIFY_DEV ? undefined : await chromium.executablePath,
- headless: chromium.headless,
- })
-
- const page = await browser.newPage()
-
- const html = `
-
-
-
-
-
-
-
-
- NEXT STEPS
-
-
-
- Hey team! 👋
-
-
-
-
- We’ve created this handy guide to answer common questions you or
- your team may have.
-
-
-
-
- CONTENTS
-
-
- -
-
- Installing PostHog......................................................
-
-
- -
-
- Plans & pricing......................................................
-
-
- -
-
- How teams are using PostHog......................................................
-
-
- -
-
- Popular tutorials......................................................
-
-
- -
-
- Learn more about PostHog......................................................
-
-
-
-
-
-
-
-
-
- `
-
- await page.setContent(html, {
- waitUntil: ['domcontentloaded'],
- })
-
- await page.evaluateHandle('document.fonts.ready')
-
- await page.setViewport({
- width: 1200,
- height: 630,
- })
-
- const buffer = await page.screenshot({
- type: 'jpeg',
- })
-
- await browser.close()
-
- return {
- statusCode: 200,
- headers: {
- 'Content-Type': 'image/jpeg',
- },
- body: buffer.toString('base64'),
- isBase64Encoded: true,
- }
-}
diff --git a/gatsby/onPostBuild.js b/gatsby/onPostBuild.js
index c52e6c36e..7a3b52a27 100644
--- a/gatsby/onPostBuild.js
+++ b/gatsby/onPostBuild.js
@@ -146,10 +146,13 @@ module.exports = exports.onPostBuild = async ({ graphql }) => {
encoding: 'base64',
})
+ const browserFetcher = chromium.puppeteer.createBrowserFetcher()
+ const revisionInfo = await browserFetcher.download('982053')
+
const browser = await chromium.puppeteer.launch({
- args: chromium.args,
- executablePath: await chromium.executablePath,
- headless: chromium.headless,
+ args: await chromium.args,
+ executablePath: revisionInfo.executablePath || process.env.PUPPETEER_EXECUTABLE_PATH,
+ headless: true,
})
const page = await browser.newPage()
await page.setViewport({
diff --git a/netlify.toml b/netlify.toml
index d8adff896..e4537bcf0 100644
--- a/netlify.toml
+++ b/netlify.toml
@@ -1150,7 +1150,7 @@
to = "/tutorials/how-to-segment-users"
[build]
- command = "AWS_LAMBDA_FUNCTION_NAME=trickpuppeteer GATSBY_DEPLOY_PRIME_URL=$DEPLOY_PRIME_URL gatsby build"
+ command = "GATSBY_DEPLOY_PRIME_URL=$DEPLOY_PRIME_URL gatsby build"
# Added: 2022-02-03
[[redirects]]
diff --git a/src/components/NextSteps/index.js b/src/components/NextSteps/index.js
index b88884b5e..25f80c02c 100644
--- a/src/components/NextSteps/index.js
+++ b/src/components/NextSteps/index.js
@@ -50,7 +50,7 @@ export default function NextSteps({ location }) {
return (