From e6354965e8c47ce039f0a0ae6e58a3d32f56e5de Mon Sep 17 00:00:00 2001 From: Taehyun Hwang Date: Mon, 8 May 2023 19:38:16 +0900 Subject: [PATCH] docs: fix ts error in example code (#10138) --- README.md | 2 +- docs/index.md | 2 +- website/versioned_docs/version-20.1.1/index.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 77b4dfa8ef8..2767e223b9c 100644 --- a/README.md +++ b/README.md @@ -163,7 +163,7 @@ import puppeteer from 'puppeteer'; const textSelector = await page.waitForSelector( 'text/Customize and automate' ); - const fullTitle = await textSelector.evaluate(el => el.textContent); + const fullTitle = await textSelector?.evaluate(el => el.textContent); // Print the full title console.log('The title of this blog post is "%s".', fullTitle); diff --git a/docs/index.md b/docs/index.md index 77b4dfa8ef8..2767e223b9c 100644 --- a/docs/index.md +++ b/docs/index.md @@ -163,7 +163,7 @@ import puppeteer from 'puppeteer'; const textSelector = await page.waitForSelector( 'text/Customize and automate' ); - const fullTitle = await textSelector.evaluate(el => el.textContent); + const fullTitle = await textSelector?.evaluate(el => el.textContent); // Print the full title console.log('The title of this blog post is "%s".', fullTitle); diff --git a/website/versioned_docs/version-20.1.1/index.md b/website/versioned_docs/version-20.1.1/index.md index 77b4dfa8ef8..2767e223b9c 100644 --- a/website/versioned_docs/version-20.1.1/index.md +++ b/website/versioned_docs/version-20.1.1/index.md @@ -163,7 +163,7 @@ import puppeteer from 'puppeteer'; const textSelector = await page.waitForSelector( 'text/Customize and automate' ); - const fullTitle = await textSelector.evaluate(el => el.textContent); + const fullTitle = await textSelector?.evaluate(el => el.textContent); // Print the full title console.log('The title of this blog post is "%s".', fullTitle);