My opinion:
Bun doesn’t fully support everything Playwright relies on, especially the parts that spawn browser processes. That “Launching Chromium…” hang usually means Bun never finishes starting the child process.
Two things you can try:
1. Run the file with Node instead of Bun
Just to confirm it isn’t your Playwright install:
node test.ts
If it works under Node but not Bun, then it’s the runtime.
2. Tell Bun not to sandbox child processes
Bun sometimes blocks Playwright’s browser launch unless this flag is set:
bun --smol run test.ts
If you want actual Playwright support, stick with Node for now — Bun still has open issues with spawning Chromium/Firefox/WebKit through Playwright. The script itself is fine; the hang is coming from Bun, not your code.
For more queries, you can check this link for reference:
https://www.weekly.playwright-user-event.org/