docs: Add instructions for bun/bunx - #26454
Conversation
|
@microsoft-github-policy-service agree company="Bun" |
Test results for "tests 1"5 failed 9 flaky 25025 passed, 583 skipped Details❌ [playwright-test] › expect-poll.spec.ts:222:5 › should show intermediate result for poll that spills over test time ❌ [playwright-test] › expect-to-pass.spec.ts:208:5 › should show intermediate result for toPass that spills over test time ❌ [playwright-test] › loader.spec.ts:755:5 › should resolve .js import to .tsx file in non-ESM mode for components ❌ [playwright-test] › reporter-html.spec.ts:1452:7 › merged › labels › filter should update stats ❌ [playwright-test] › ui-mode-trace.spec.ts:53:5 › should merge web assertion events Retry 1: Retry 2: Retry 3: Merge workflow run. |
ef640cc to
4e8be84
Compare
Test results for "tests 1"1 failed 13 flaky 25025 passed, 583 skipped Details❌ [playwright-test] › reporter-html.spec.ts:1452:7 › created › labels › filter should update stats Merge workflow run. |
| <TabItem value="bun"> | ||
|
|
||
| ```bash | ||
| bunx create-playwright |
There was a problem hiding this comment.
Apologies, how are you running this? Are you on a recent version of Bun? If bunx isn't available it's possibly quite old.
I see a different error (which I can also replicate with npx).
Note that bunx respects the shebang line in create-playwright so it should behave identically to npx.
$ bunx create-playwright
Getting started with writing end-to-end tests with Playwright:
Initializing project in '.'
✔ Where to put your end-to-end tests? · playwright
✔ 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! Invalid Version:
npm ERR! A complete log of this run can be found in: /Users/colinmcd94/.npm/_logs/2023-08-15T00_10_16_493Z-debug-0.log
Error: Command failed: npm install --save-dev @playwright/test
at checkExecSyncError (node:child_process:887:11)
at execSync (node:child_process:959:15)
at executeCommands (/private/tmp/create-playwright@latest--bunx/node_modules/create-playwright/lib/index.js:4519:39)
at Generator.run (/private/tmp/create-playwright@latest--bunx/node_modules/create-playwright/lib/index.js:4679:5)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async /private/tmp/create-playwright@latest--bunx/node_modules/create-playwright/lib/index.js:4952:3 {
status: 1,
signal: null,
output: [ null, null, null ],
pid: 12934,
stdout: null,
stderr: null
}
error: "create-playwright" exited with code 1 (SIGHUP)There was a problem hiding this comment.
I used the latest bun available on bun.sh 0.7.3
There was a problem hiding this comment.
I'm able to replicate your error when I do bunx --bun create-playwright which runs the create-playwright CLI with the Bun runtime. Opened an issue here: oven-sh/bun#4153
Though without the --bun flag this command should respect the shebang line and run the CLI with Node.js. Maybe you have a global bunfig.toml that changes this behavior?
I'm able to run bunx create-playwright successfully on my machine now...I think that "Invalid Version" error was a transient npm registry issue.
There was a problem hiding this comment.
It was a fresh installation from bun.sh on GitHub Codespaces, so no global bunfig.toml was present.
Generally speaking we should try to run our testsuite "npm run ctest" with bun and see how many tests pass/are failing.
Test results for "tests 1"1 failed 14 flaky 25024 passed, 583 skipped Details❌ [playwright-test] › reporter-html.spec.ts:1452:7 › created › labels › filter should update stats Merge workflow run. |
|
Let's wait for the users to request interop with bun. We don't know if it works, so documenting it would be potentially setting up users for failure. |
|
Pavel Feldman (@pavelfeldman) FYI, it seems like Bun runtime support is close, but now stuck on this issue with imports/exports - oven-sh/bun#2492 (comment) |
|
Without adding bots / testing infrastructure to make sure all the Playwright tests pass on bun, we are not confident enough to recommend this to our users. |

No description provided.