Skip to content

[v4] @tailwindcss/vite crashing dev server with _ has already been declared errors #15250

@huntabyte

Description

@huntabyte

What version of Tailwind CSS are you using?

4.0.0-beta.4 for both tailwindcss and @tailwindcss/vite

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

Svelte 5/Vite

What version of Node.js are you using?

v20.15.1

What browser are you using?

Chrome

What operating system are you using?

macOS

Reproduction URL

https://github.com/huntabyte/tw-v4-monorepo-repro/tree/main

Repro info below can also be found in the README.md of the reproduction repo.

This reproduction contains the following:

  • ui package which exports a (in reality would be) styled Button component which uses a primitive headless component from bits-ui.
  • docs package which uses ui and @tailwindcss/vite@next & tailwindcss@next.

Reproduction Steps

  1. pnpm install && pnpm dev in the root of the repo (will build the ui package and start the docs dev server)
  2. Notice that the page renders and all is well.
  3. Open the docs/vite.config.ts file and add tailwindcss() to the plugins array / save the file.
  4. Notice the dev server crashes with a bunch of pre-transform errors (p has already been declared).
  5. Remove the tailwindcss() plugin from the docs/vite.config.ts file and save the file.
  6. Notice that the dev server starts as normal.

Describe your issue

Working in a pnpm monorepo, @tailwindcss/vite@next causes the dev server to crash with vite pre-transform - p has already been declared errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions