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
pnpm install && pnpm dev in the root of the repo (will build the ui package and start the docs dev server)
- Notice that the page renders and all is well.
- Open the
docs/vite.config.ts file and add tailwindcss() to the plugins array / save the file.
- Notice the dev server crashes with a bunch of pre-transform errors (
p has already been declared).
- Remove the
tailwindcss() plugin from the docs/vite.config.ts file and save the file.
- 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.
What version of Tailwind CSS are you using?
4.0.0-beta.4 for both
tailwindcssand@tailwindcss/viteWhat 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.mdof the reproduction repo.This reproduction contains the following:
uipackage which exports a (in reality would be) styledButtoncomponent which uses a primitive headless component frombits-ui.docspackage which usesuiand@tailwindcss/vite@next&tailwindcss@next.Reproduction Steps
pnpm install && pnpm devin the root of the repo (will build theuipackage and start thedocsdev server)docs/vite.config.tsfile and addtailwindcss()to thepluginsarray / save the file.p has already been declared).tailwindcss()plugin from thedocs/vite.config.tsfile and save the file.Describe your issue
Working in a
pnpmmonorepo,@tailwindcss/vite@nextcauses the dev server to crash with vite pre-transform -p has already been declarederrors.