Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Compatibility with bun #27139

Closed
lgarron opened this issue Sep 17, 2023 · 4 comments
Closed

[Feature] Compatibility with bun #27139

lgarron opened this issue Sep 17, 2023 · 4 comments

Comments

@lgarron
Copy link

lgarron commented Sep 17, 2023

#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.

@mxschmitt
Copy link
Member

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.

@mxschmitt mxschmitt closed this as not planned Won't fix, can't repro, duplicate, stale Sep 18, 2023
@joshua-bn
Copy link

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.

@vitalics
Copy link

@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.

@ngocphamm
Copy link

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants