Skip to content

playwright install is added to prepare script on unsupported systems. #1062

@bnn1

Description

@bnn1

Problem

When I create a new sveltekit application with playwright, or install any library afterwards an error flashes but it disappears immediately leaving me confused.

image Image

The cause

When you run playwright install on an unsupported system (like Arch) it fails. playwright install is added to prepare script which runs every time you install a new library.

It was implemented recently to address this issue #1038

@Rich-Harris wrote

I just set up a project with Playwright, tried pnpm test and hit a giant wall of console spam. The pnpm exec playwright install instruction was buried in the middle of a bunch of other junk — if I didn't know better I could well have missed it. Made me think we should just do this automatically when installing the Playwright add-on?

But after bootstrapping a SvelteKit application there's an instruction that says "install playwright bro"

image Image

If you use Storybook addon it installs browsers for you if you choose so.

The solution

Remove playwright install from the prepare script and either:

  1. make "Run npx playwright install to download browsers" text bigger so it's easier to spot the instruction
  2. ask if user wants to install playwright as an additional installation step (similar to when Storybook addon is used - and remove playwright installation from storybook step)

OR
Conditionally add playwright install to prepare script on systems that support it.

OR
Add an instruction to remove playwright install from prepare script on unsupported systems to avoid confusing errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions