-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Closed
Description
What version of Tailwind CSS are you using?
4.0.3
What build tool (or framework if it abstracts the build tool) are you using?
vite
What version of Node.js are you using?
v23.7.0
What browser are you using?
Chrome
What operating system are you using?
macOS
Reproduction URL
https://codesandbox.io/p/devbox/laughing-williamson-s5kvz2?file=%2Fmain.js%3A4%2C37
Describe your issue
Running vite build in the linked CodeSandbox results in:
workspace git:(main) ✗ pnpm build
> vite-js@0.0.0 build /project/workspace
> vite build
vite v6.0.11 building for production...
✓ 418 modules transformed.
x Build failed in 3.40s
error during build:
[@tailwindcss/vite:generate:build] Invalid declaration: `import * as maplibreGl from "/project/workspace/node_modules/.pnpm/maplibre-gl@4.7.1/node_modules/maplibre-gl/dist/maplibre-gl.css"`
file: /project/workspace/node_modules/.pnpm/maplibre-gl@4.7.1/node_modules/maplibre-gl/dist/maplibre-gl.css?commonjs-proxy
at X (file:///project/workspace/node_modules/.pnpm/tailwindcss@4.0.3/node_modules/tailwindcss/dist/lib.mjs:3:1804)
at tl (file:///project/workspace/node_modules/.pnpm/tailwindcss@4.0.3/node_modules/tailwindcss/dist/lib.mjs:33:1566)
at tt (file:///project/workspace/node_modules/.pnpm/@tailwindcss+node@4.0.3/node_modules/@tailwindcss/node/dist/index.mjs:10:3328)
at _.generate (file:///project/workspace/node_modules/.pnpm/@tailwindcss+vite@4.0.3_vite@6.0.11/node_modules/@tailwindcss/vite/dist/index.mjs:1:5387)
at Object.transform (file:///project/workspace/node_modules/.pnpm/@tailwindcss+vite@4.0.3_vite@6.0.11/node_modules/@tailwindcss/vite/dist/index.mjs:1:3735)
at Object.handler (file:///project/workspace/node_modules/.pnpm/vite@6.0.11/node_modules/vite/dist/node/chunks/dep-M1IYMR16.js:51337:15)
at file:///project/workspace/node_modules/.pnpm/rollup@4.24.4/node_modules/rollup/dist/es/shared/node-entry.js:20789:40
ELIFECYCLE Command failed with exit code 1.
The same codebase used to work when running tailwind 3 via postcss. I also tried excluding the file via content: ["./index.html", "./**/*.js", "!**/maplibre-gl.css"], but without any success.
Reactions are currently unavailable