Describe the bug
most of the issue is written by AI
Vite 8.2.x can emit hashed CSS assets while leaving the original source-relative url() unchanged. The generated CSS then points at a source path that is not present beside the output CSS file.
The regression reproduces in two independent configurations:
- Sass with
postcss-lightningcss.
@tailwindcss/vite with an empty PostCSS configuration.
Both fixtures produce the expected asset URLs with Vite 8.1.5. With Vite 8.2.2, the asset files are still emitted but the CSS references stale relative URLs.
Reproduction
https://github.com/Razunter/vite-82-css-bug-repro
Steps to reproduce
-
Clone the reproduction repo.
-
Install dependencies:
-
Run the four comparison builds:
npm run build:postcss:8.1.5
npm run build:postcss:8.2.2
npm run build:tailwind:8.1.5
npm run build:tailwind:8.2.2
-
Inspect the generated CSS files under the four dist-* directories.
Each script invokes its Vite version through npx --yes; the fixture manifest itself remains pinned to Vite 8.2.2.
System Info
System:
OS: Linux 6.18.33.1-microsoft-standard-WSL2 x64
Environment: DDEV on WSL2
Binaries:
Node: 24.18.0
npm: 11.16.0
Packages:
vite: 8.2.2
rolldown: 1.2.5
@tailwindcss/vite: 4.3.3
postcss-lightningcss: 1.1.1
sass: 1.103.0
tailwindcss: 4.3.3
Used Package Manager
npm
Logs
The builds complete successfully; the failure is visible in the emitted CSS.
Vite 8.1.5 / PostCSS:
url(/assets/Roboto-Regular-BKwBj7lc.ttf)
url(/vite-css-url-repro.webp)
Vite 8.2.2 / PostCSS:
url(../fonts/Roboto-Regular.ttf)
url(/vite-css-url-repro.webp)
Vite 8.1.5 / Tailwind:
url(/assets/vite-css-url-repro-HxSRdrt5.webp)
url(/vite-css-url-repro.webp)
Vite 8.2.2 / Tailwind:
url(../images/vite-css-url-repro.webp)
url(/vite-css-url-repro.webp)
Validations
Describe the bug
most of the issue is written by AI
Vite 8.2.x can emit hashed CSS assets while leaving the original source-relative
url()unchanged. The generated CSS then points at a source path that is not present beside the output CSS file.The regression reproduces in two independent configurations:
postcss-lightningcss.@tailwindcss/vitewith an empty PostCSS configuration.Both fixtures produce the expected asset URLs with Vite 8.1.5. With Vite 8.2.2, the asset files are still emitted but the CSS references stale relative URLs.
Reproduction
https://github.com/Razunter/vite-82-css-bug-repro
Steps to reproduce
Clone the reproduction repo.
Install dependencies:
Run the four comparison builds:
Inspect the generated CSS files under the four
dist-*directories.Each script invokes its Vite version through
npx --yes; the fixture manifest itself remains pinned to Vite 8.2.2.System Info
Used Package Manager
npm
Logs
The builds complete successfully; the failure is visible in the emitted CSS.
Validations