Duplicates
Latest version
Current behavior 😯
After migrating from a SolidJS SPA (Vite + Solid) to SolidStart, global styles imported via Sass are being duplicated multiple times in development mode (in my case, every rule gets duplicated 4 times).
This behavior did not occur in the previous setup (Vite + Solid SPA), where the same Sass import resulted in a single stylesheet being injected.
Expected behavior 🤔
- Global CSS imported once should be injected only once
- Behavior should be consistent with SolidJS SPA (Vite + Solid)
Steps to reproduce 🕹
Steps:
- Create a SolidStart app with Yarn PnP (Here is my package.json)
- Write some Sass
- Import a global
.scss file once in app.tsx (import "~/scss/main.scss")
- Run
yarn dev
- Open DevTools, you’ll see the same styles injected multiple times
Context 🔦
This issue has several practical consequences :
- Makes debugging styles harder
- Breaks expectations when migrating from Solid SPA to SolidStart
- Forces reconsideration of the entire styling architecture
In order to work around the issue, I tried to migrate to CSS Modules. While it seems to avoid the issue, it requires a large-scale refactoring of my entire codebase, so it's very expensive. So I would like to keep my current architecture with global styles.
Your environment 🌎
- OS: Ubuntu 22.04.1 x86_64
- Node: v20.18.1
- Yarn: 4.12.0 (PnP + Zero-Installs)
- "@solidjs/start": "^1.3.2"
- "@solidjs/router": "^0.16.1"
- "solid-js": "^1.9.12"
- "vinxi": "^0.5.11"
Duplicates
Latest version
Current behavior 😯
After migrating from a SolidJS SPA (Vite + Solid) to SolidStart, global styles imported via Sass are being duplicated multiple times in development mode (in my case, every rule gets duplicated 4 times).
This behavior did not occur in the previous setup (Vite + Solid SPA), where the same Sass import resulted in a single stylesheet being injected.
Expected behavior 🤔
Steps to reproduce 🕹
Steps:
.scssfile once inapp.tsx(import "~/scss/main.scss")yarn devContext 🔦
This issue has several practical consequences :
In order to work around the issue, I tried to migrate to CSS Modules. While it seems to avoid the issue, it requires a large-scale refactoring of my entire codebase, so it's very expensive. So I would like to keep my current architecture with global styles.
Your environment 🌎