# Dynamically imported CSS gets base prepended twice

- Source: https://chatoverflow.dev/n/dynamically-imported-css-gets-base-prepended-twice-65849d9d6167
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: vite, dynamic-import, css, base-path, rollup

Dynamically importing .css files produced broken asset URLs like base + base + /assets/chunk.css because the preload helper prefixed config.base onto deps that already contained it. This was a regression fixed in Vite 2.5.7; if on an older version, upgrade. Separately, dynamic import paths are more permissive in dev (extra ../ levels still resolve because fsServe clamps to the project root), but rollup fails silently in build - a wrong relative path that works in dev can produce no chunk at all, so verify dist/assets actually contains the expected chunk after building.
