Comments (7)
I am seeing this same issue, introduced a little over a week ago.
from solid-start.
Minimial reproduction repository
from solid-start.
@hansoksendahl do you know the last version where it was working? That would help me narrow it down considerably.
from solid-start.
This is a vinxi issue right? Vinxi sends the hmr update to replace the css, classes don't match anymore, styling disappears and reload is required.
No sure if there is a way around a reload but here is where to look I think. Maybe sending a full-reload
for css modules?
https://github.com/nksaraf/vinxi/blob/4bddafe1b7e873ef691392ebaf7ea4f4875e39d4/packages/vinxi/lib/plugins/css.js#L15
Edit: Oh... it looks to me as if the return value (empty array) is the problem causing vite to only send the custom event. I will make a PR later.
from solid-start.
This issue is persisting for me still is there an update on what is going on with this? @edivados Thanks in advance
from solid-start.
Downgrading vinxi to 3.10 should temporarily avoid this issue?
from solid-start.
A not so nice temporary fix for this is to customize the class name generator vite uses in the config to only use the file path and class name and ignore the css contents when generating class names. This means that class names don't change when the contents changes, which I believe is whats causing the issues.
Example config.
import crypto from "crypto"
export default defineConfig({
ssr: true,
vite: {
css: {
modules: {
// Need to generate css module names based on only the file path and class name
// because the dev reloading doesn't work well when classes change when css contents change.
generateScopedName(name, filename, css) {
const hasher = crypto.createHash("sha256")
hasher.update(name + filename)
const hash = hasher.digest().toString("hex");
return `${name}__${hash.substring(0, 16)}`
},
}
}
}
});
There is one problem with this though, it doesn't fix the issue of you adding a new class in the css, as it goes from an empty string to some value and therefore that still requires a page refresh.
from solid-start.
Related Issues (20)
- [Bug?]: Cannot get response returned by a server function via a GET request HOT 1
- [Bug?]:TypeError: Cannot read properties of null (reading 'FormContext')
- [Bug?]: [vite] Pre-transform error: xxx.tsx: Property value expected type of boolean but got undefined HOT 1
- [Bug?]: Server action chunks are not generated in production build when using `experimental.islands` HOT 5
- [Feature?]: Websocket for SolidStart/SolidJS, instead of fetch HOT 2
- Issue with File Updates on Dev Server HOT 1
- [Feature?]: Tailwind template should come with automatic theme switching support "out-of-the-box"
- [Bug?]: Hydration Mismatch for passed JSX elements HOT 5
- [Bug?]: `compressPublicAssets` nitro config does not work HOT 4
- [Bug?]: Wrong server function called due to incorrect handling of file hash collisions for server func sources
- [Bug?]: Landing page is broken on small screen size
- [Bug?]: how to prerender *404 page? HOT 2
- [Feature?]: Add an option to disable lazy loading in `<FileRoutes />` HOT 3
- [Bug?]: "Zero-config" Netlify provider does not load a Netlify preset automatically HOT 4
- [Bug?]: TypeError: Response body object should not be disturbed or locked HOT 3
- [Bug?]: pnpm create solid@latest doesn't work HOT 1
- [Bug?]: Using layouts with route groups at root level causes hydration errors HOT 1
- [Bug?]: Unexpected Link Element Generation for Stylesheet Imports in Production Environment HOT 1
- API routes have to be inline exported function declarations
- [Feature?]: Add ability to add/modify head classes, lang and lang dir
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from solid-start.