Skip to content

[Bug]: Test: Playwright Install in VSCode command Generated wrong command. #40076

@KayabaZeref

Description

@KayabaZeref

Version

1.41.1

Steps to reproduce

  1. Open VSCode.
  2. Install Playwright extensions from VSCode.
  3. Create New Project
  4. Crtl + P to open VSCode command
  5. Type "Test: Playwright Install"
  6. Select: "Chorium, Firefox, and Github."
  7. Press Enter

Expected behavior

The command will run the npm script and install Playwright successfully.

Actual behavior

An error occurred stating

_(My Project path)_ "npm init playwright@latest --yes "--" . '--quiet' '--browser=chromium' '--browser=firefox' '--browser=webkit' '--gha' 

> npx
> create-playwright . '--quiet' '--browser=chromium' '--browser=firefox' '--browser=webkit' '--gha'
error: too many arguments. Expected 1 argument but got 6.
npm error code 1
npm error path _(My Project path)_
Microsoft Windows [Version 10.0.26200.8037]"

Additional context

The corrected command should be:
npm init playwright@latest --yes "--" --quiet --browser chromium firefox webkit --gha
The issue was with the --browser option syntax. Instead of using --browser=chromium --browser=firefox --browser=webkit, you need to use --browser chromium firefox webkit (without the = and as a single option with multiple values).

Environment

npx envinfo --preset playwright

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions