Bug repro: Vite 8 + pnpm + Windows — SCSS
@usefails when the packageexportsfield maps a wildcard path via thesasscondition to an underscore-prefixed partial.
When using @use to import an SCSS partial from a package that exposes it via the sass exports condition:
@use '@vite-sass-bug/example/styles/mixins';The package's exports field is:
- Linux / macOS – Vite constructs the sub-path as
./styles/_mixins(forward slash), which correctly matches the./styles/*pattern. Build succeeds. ✔ - Windows – Vite constructs the sub-path as
./styles\_mixins(backslash), which does not match./styles/*. Build fails. ✘
[vite] Pre-transform error: [sass] Error:
"./styles\_mixins" is not exported under the conditions
["sass", "style", "development", "import"]
from package @vite-sass-bug/example
(see exports field in …\node_modules\@vite-sass-bug\example\package.json)
packages/
example/ ← Package with underscore-prefixed _mixins.scss + exports `sass` condition
vite-app/ ← Vite 8 starter that does @use 'example/styles/mixins'
pnpm install
pnpm --filter vite-app run build # succeeds on Linux/macOS, fails on WindowsThe GitHub Actions workflow runs vite build on all three platforms:
| Platform | Expected result |
|---|---|
| ubuntu-latest | ✅ passes |
| macos-latest | ✅ passes |
| windows-latest | ❌ fails (bug) |