Skip to content

[Feature] Compatibility with bun #27139

Closed as not planned
Closed as not planned

Description

@lgarron

#26454 (comment) states:

Let's wait for the users to request interop with bun.

I'm a user, and I am requesting interop with bun! 🙋😄

I've just switched my largest project to bun (now that bun 1.0 has been released), and everything works perfectly except running tests in Playwright.

A lot of packages run in bun without issue, but both bun and Playwright have difficult jobs, so it's not surprising that there would be challenges. Like npx playwright, Bun supports TypeScript and running tests directly — so I think it's fair to say that a developer who likes the ergonomics of either would be a good candidate for interest in the other.

oven-sh/bun#2492 documents many folks trying to use Playwright from bun, although I don't understand the situation well enough to help fix it. But if there is anything Playwright can do to help be more compatible in bun, I'd be glad to be able to use that as soon as possible.

Activity

  1. mxschmitt commented on Sep 18, 2023

    @mxschmitt
    Contributor

    As of today Bun is not Node.js compatible, a lot of things are still missing or behaving different. This is not something we can act on/can improve.

    Once they are Node.js compatible and have the missing Node.js APIs implemented, we might reconsider putting a bun section into our docs.

  2. joshua-bn commented on Sep 24, 2023

    @joshua-bn

    As of today Bun is not Node.js compatible, a lot of things are still missing or behaving different. This is not something we can act on/can improve.

    Once they are Node.js compatible and have the missing Node.js APIs implemented, we might reconsider putting a bun section into our docs.

    Do you have a list of APIs that are missing for Playwright?

    There appears to be quite a bit of logic that checks Node version. That's probably a show stopper to start. Not only will it not work with bun, it doesn't appear that it will work with Deno or alternative runtimes.

  3. vitalics commented on Sep 25, 2023

    @vitalics

    Joshua Dickerson (@joshua-bn) You can use bun with the playwright. It is already described in my blog post here. Despite "hello world" run I have a few tests on my current project and Buns does not give a big performance for playwright tests, since the playwright bottleneck performance - is sending commands in your browser via Chrome remote CDP API, which executes your code.

  4. ngocphamm commented on Sep 25, 2023

    @ngocphamm

    Vitali Haradkou (@vitalics) What command did you use to run the tests "with" bun?

    From my understanding bunx playwright test will still use NodeJS to run the tests, accodring to this line when I type bunx alone in the command line.

    The --bun flag forces the package to run in Bun's JavaScript runtime, even when it tries to use Node.js.

    I think we will only get the issue when we run bunx --bun playwright test.

  5. milosworks commented on Jun 7, 2025

    @milosworks

    @joshua-bn You can use bun with the playwright. It is already described in my blog post here. Despite "hello world" run I have a few tests on my current project and Buns does not give a big performance for playwright tests, since the playwright bottleneck performance - is sending commands in your browser via Chrome remote CDP API, which executes your code.

    For anyone also looking into this, currently when you try and run test with playwright bun will use node, if you even try to use --bun to force playwright to use buns runtime this wouldnt work.

  6. javi-cardenas-ke commented on Aug 21, 2025

    @javi-cardenas-ke

    As of today Bun is not Node.js compatible, a lot of things are still missing or behaving different. This is not something we can act on/can improve.

    Once they are Node.js compatible and have the missing Node.js APIs implemented, we might reconsider putting a bun section into our docs.

    From the maintainers of bun:

    If a package works in Node.js but doesn't work in Bun, we consider it a bug in Bun. Please open an issue and we'll fix it.

    https://bun.sh/docs/runtime/nodejs-apis

  7. MBanucu commented on Jan 24, 2026

    @MBanucu

    For anyone also looking into this, currently when you try and run test with playwright bun will use node, if you even try to use --bun to force playwright to use buns runtime this wouldnt work.

    #27139 (comment)

    playwright version 1.58 seems to work with bun 1.3.6. See also https://github.com/MBanucu/bun-playwright-nix

  8. mirao commented on Sep 17, 2026

    @mirao

    Found this note: https://bun.com/blog/bun-v1.4#playwright
    BTW I'm running CodeceptJS 4.1 + Playwright 1.62.1, with Bun 1.4.2. Everything works well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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