Skip to content

bun-plugin-tailwind: peerDependency on "bun" causes broken npm bun package to shadow global Bun installation, breaking all scripts #19471

@Mark-Life

Description

@Mark-Life

What version of Tailwind CSS are you using?

v4.1.18

What build tool (or framework if it abstracts the build tool) are you using?

Bun 1.3.5 with bun-plugin-tailwind 0.1.2

What version of Node.js are you using?

N/A (using Bun runtime)

What browser are you using?

N/A

What operating system are you using?

macOS

Reproduction URL

  1. Create a new project: bun init
  2. Add to package.json:
{
  "dependencies": {
    "bun-plugin-tailwind": "^0.1.2"
  },
  "scripts": {
    "dev": "bun --hot src/index.ts"
  }
}
  1. Run bun install && bun run dev

Describe your issue

bun-plugin-tailwind declares bun as a peer dependency in its package.json:

"peerDependencies": {
  "bun": ">=1.0.0"
}

This causes Bun to install the bun npm package, which creates node_modules/.bin/bun and node_modules/.bin/bunx symlinks. However, these binaries are 0-byte placeholder files that fail to execute.

When running bun run <script>, Bun prepends node_modules/.bin to PATH, so it finds the broken npm-installed bun binary instead of the global Bun installation. This causes all scripts to silently fail with exit code 1.

Expected behavior: Scripts defined in package.json should work with bun run dev.

Workaround: Add override to package.json to prevent the bun npm package from being installed:

"overrides": {
  "bun": "link:."
}

Suggested fix: Remove bun from peerDependencies. Since this plugin only works within the Bun runtime, requiring bun as a peer dependency is unnecessary — Bun is always present when using this package.

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