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
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
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:
- make "Run npx playwright install to download browsers" text bigger so it's easier to spot the instruction
- 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.
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
The cause
When you run
playwright installon an unsupported system (like Arch) it fails.playwright installis added topreparescript which runs every time you install a new library.It was implemented recently to address this issue #1038
@Rich-Harris wrote
But after bootstrapping a SvelteKit application there's an instruction that says "install playwright bro"
image
If you use Storybook addon it installs browsers for you if you choose so.
The solution
Remove
playwright installfrom the prepare script and either:OR
Conditionally add
playwright installtopreparescript on systems that support it.OR
Add an instruction to remove
playwright installfrom prepare script on unsupported systems to avoid confusing errors.