0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

playwright.config.ts が include されておらず「Cannot find name 'process'」が発生した

0
Posted at

やりたいこと

playwright.config.ts で発生した型エラーを解消する。

実行したこと

playwright.config.ts を開きました。

実行結果

process に型エラーが表示されました。

エラー内容

Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig.

原因調査

エラー文の以下の内容を確認しました。

then add 'node' to the types field in your tsconfig.

原因

playwright.config.tstsconfig.node.json の対象に含まれていなかったため、型定義が適用されていませんでした。

解決策

tsconfig.node.jsonincludeplaywright.config.ts を追加しました。

{
  "include": ["vite.config.ts", "playwright.config.ts"]
}

playwright.config.ts が TypeScript の設定対象となり、process の型エラーが解消しました。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?