From 532cf453931e043cdf0b470883bf6a343f20f0d9 Mon Sep 17 00:00:00 2001 From: Dmitry Gozman Date: Thu, 21 Jul 2022 19:21:49 -0700 Subject: [PATCH] docs: mention node 16 requirement for ts + esm (#15866) --- docs/src/test-typescript-js.md | 4 ++++ docs/src/troubleshooting-js.md | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/src/test-typescript-js.md b/docs/src/test-typescript-js.md index 6c5738e145..8943b60d0e 100644 --- a/docs/src/test-typescript-js.md +++ b/docs/src/test-typescript-js.md @@ -67,6 +67,10 @@ test('example', async ({ page }) => { }); ``` +:::note +TypeScript with ESM requires Node.js 16 or higher. +::: + ## TypeScript path mapping If you use [path mapping](https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping) in your `tsconfig.json`, Playwright Test will pick it up. Make sure that `baseUrl` is also set. diff --git a/docs/src/troubleshooting-js.md b/docs/src/troubleshooting-js.md index 06f084c280..007a9f0f81 100644 --- a/docs/src/troubleshooting-js.md +++ b/docs/src/troubleshooting-js.md @@ -30,7 +30,11 @@ await page.evaluate(`(async() => { ### ReferenceError: URL is not defined -Playwright requires Node.js 14 or higher. Node.js 8 is not supported, and will cause you to receive this error. +Playwright requires Node.js 14 or higher. + +### Unknown file extension ".ts" + +Running TypeScript tests in `"type": "module"` project requires Node.js 16 or higher. # Please file an issue