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

Remove Bun support #8039

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Remove Bun support #8039

wants to merge 5 commits into from

Conversation

penalosa
Copy link
Contributor

@penalosa penalosa commented Feb 5, 2025

Fixes https://jira.cfdata.org/browse/DEVX-1621

Adds a fast fail error to Wrangler when run using Bun, as well as removing Bun support from C3. Bun is not supported by Wrangler or Miniflare, and so allowing users to use Bun to run C3 was not setting people up for success—we see issues come in relatively frequently about people trying to use Bun with Wrangler/Miniflare, thinking it'd work because of C3's support.


  • Tests
    • TODO (before merge)
    • Tests included
    • Tests not necessary because:
  • E2E Tests CI Job required? (Use "e2e" label or ask maintainer to run separately)
    • I don't know
    • Required
    • Not required because: n/a
  • Public documentation

@penalosa penalosa requested review from a team as code owners February 5, 2025 21:03
Copy link

changeset-bot bot commented Feb 5, 2025

🦋 Changeset detected

Latest commit: 16a5042

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
create-cloudflare Minor
wrangler Patch
@cloudflare/vitest-pool-workers Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented Feb 5, 2025

A wrangler prerelease is available for testing. You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13200984815/npm-package-wrangler-8039

You can reference the automatically updated head of this PR with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/8039/npm-package-wrangler-8039

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13200984815/npm-package-wrangler-8039 dev path/to/script.js
Additional artifacts:

cloudflare-workers-bindings-extension:

wget https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13200984815/npm-package-cloudflare-workers-bindings-extension-8039 -O ./cloudflare-workers-bindings-extension.0.0.0-vad1e093c7.vsix && code --install-extension ./cloudflare-workers-bindings-extension.0.0.0-vad1e093c7.vsix

create-cloudflare:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13200984815/npm-package-create-cloudflare-8039 --no-auto-update

@cloudflare/kv-asset-handler:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13200984815/npm-package-cloudflare-kv-asset-handler-8039

miniflare:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13200984815/npm-package-miniflare-8039

@cloudflare/pages-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13200984815/npm-package-cloudflare-pages-shared-8039

@cloudflare/unenv-preset:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13200984815/npm-package-cloudflare-unenv-preset-8039

@cloudflare/vite-plugin:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13200984815/npm-package-cloudflare-vite-plugin-8039

@cloudflare/vitest-pool-workers:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13200984815/npm-package-cloudflare-vitest-pool-workers-8039

@cloudflare/workers-editor-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13200984815/npm-package-cloudflare-workers-editor-shared-8039

@cloudflare/workers-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13200984815/npm-package-cloudflare-workers-shared-8039

@cloudflare/workflows-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13200984815/npm-package-cloudflare-workflows-shared-8039

Note that these links will no longer work once the GitHub Actions artifact expires.


[email protected] includes the following runtime dependencies:

Package Constraint Resolved
miniflare workspace:* 3.20250129.0
workerd 1.20250204.0 1.20250204.0
workerd --version 1.20250204.0 2025-02-04

Please ensure constraints are pinned, and miniflare/workerd minor versions match.

@@ -41,6 +42,13 @@ import type { C3Args, C3Context } from "types";
const { npm } = detectPackageManager();

export const main = async (argv: string[]) => {
if (process.versions.bun || npm === "bun") {
console.warn(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was a regression in Bun v1.2.0 that impacted this, but that regression was fixed in Bun v1.2.1. I manually verified it works without error in Bun v1.2.1 and Bun v1.2.2 (and that it regressed in Bun v1.2.0, which matches what you saw in the CI runs). We are adding more tests from Node.js' test suite to catch bugs like this in the future.

Is this warning still needed? We will fix anything else that comes up

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so. Bun’s continued disregard for ecosystem compatibility puts burden on third party maintainers, as well as the community where often “use Node.js” is the solution to most issues once Bun is discovered to be used.

In my opinion, until Bun commits to join something like WinterTC and work closely with other runtimes before implementing ecosystem breaking or diverging features, I don’t imagine this burden will change.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that the error has been changed to a warning, I'd personally still go with the error so users are aware - a good portion of the questions we get in the Discord could be resolved by the user if they read the message.

And with bun, most of the time the solution is to use node, and things magically start working.

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

Successfully merging this pull request may close these issues.

4 participants