You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to set up Playwright in my NextJS 14 project (which is built using a bun monorepo).
Unfortunately, the initial install step is failing when using bun because the install script tries to use npm package manager instead of bun. This is completely failing in a monorepo setup, because npm can't handle it. But even if the install step initially did work installiing via npm, then I'm assuming it still wouldn't correctly work with bun's lockfile as it's using a different package manager.
System info
Playwright Version: [v1.41.2]
Operating System: MacOS
Browser: N/A
Other info: N/A
Source code
bun create playwright
Getting started with writing end-to-end tests with Playwright:
Initializing project in'.'
✔ Where to put your end-to-end tests? · tests
✔ Add a GitHub Actions workflow? (y/N) · false
✔ Install Playwright browsers (can be done manually via 'npx playwright install')? (Y/n) · true
Installing Playwright Test (npm install --save-dev @playwright/test)…
npm ERR! code EUNSUPPORTEDPROTOCOL
npm ERR! Unsupported URL Type "workspace:": workspace:../../packages/backend-api
Steps bun create playwright
Expected
Install script works and uses bun instead of npm
Actual
Install Script fails because it's using the wrong package manager
The text was updated successfully, but these errors were encountered:
Hey @pavelfeldman , from what I see it appears that the blocking issues preventing bun from working were closed as resolved 2 weeks ago: oven-sh/bun#4751
After a little more tinkering I was able to get this working with bun successfully. The hard part was just getting it installed properly: yarn create also failed for me (because it didn't like the bun monorepo), but pnpm create worked to create the Playwright install files (I just discarded the lockfile afterwards).
Calling via the bun cli, the sample tests work just fine for me:
$ bunx playwright test
Running 6 tests using 6 workers
6 passed (4.0s)
To open last HTML report run:
npx playwright show-report
[edit]: I tested bunx playwright test and bunx playwright show-report and both work successfully. It does not work when I use npx playwright test and npx playwright show-report (likely due to monorepo), so bun's runtime appears to be working successfully.
Would you reconsider marking this as complete (or create a new issue) until there is a better solution? Even if bun has no plans to be officially supported, at least putting some documentation on the website would be helpful 🙏🏼
I'm trying to set up Playwright in my NextJS 14 project (which is built using a bun monorepo).
Unfortunately, the initial install step is failing when using
bun
because the install script tries to usenpm
package manager instead ofbun
. This is completely failing in a monorepo setup, becausenpm
can't handle it. But even if the install step initially did work installiing vianpm
, then I'm assuming it still wouldn't correctly work with bun's lockfile as it's using a different package manager.System info
Source code
Steps
bun create playwright
Expected
Install script works and uses
bun
instead ofnpm
Actual
Install Script fails because it's using the wrong package manager
The text was updated successfully, but these errors were encountered: