[BUG] Classes not re-generating without full server restart in SSR frameworks
See original GitHub issueMinimal reproduction with steps:
https://github.com/AaronBeaudoin/unocss-issue-server-only
Description
UnoCSS classes in vite-plugin-ssr
~“server”~ pages ~(page files ending in .server.page.xyz
)~ are generated once when the page is first loaded, but are not regenerated on file modifications. A full server restart is required to see the changes.
Issue Analytics
- State:
- Created a year ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
The absurd complexity of server-side rendering - Hacker News
You don't need to regenerate the entire site. You only need to regenerate the pages that have changed and maybe some indexes. Considering...
Read more >SSR Specification · Issue #109 · solidjs/solid - GitHub
We are just trying to render to string for rendering on the server, so having to pass in a dom node and having...
Read more >Next.js: The Good, Bad and Ugly - An Idiosyncratic Blog
Next.js is a framework for SSG SSR apps. But it is not all sunshine and ... No need to maintain a separate build...
Read more >NextJS / React SSR: 21 Universal Data Fetching Patterns ...
Why is there no simple way to universal data fetching in NextJS? To answer this question, let's have a look at the challenges...
Read more >A Complete Guide To Incremental Static Regeneration (ISR ...
Incremental Static Regeneration (ISR) is a new evolution of the Jamstack, allowing you to update static content instantly without needing a ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
When using vite-plugin-ssr in HTML-only mode then
uno.css
is not imported from JavaScript. Instead it is directly injected into the HTML. (Which makes sense since HTML-only is about having no/minimal browser-side JavaScript.)That said, it would still be possible for vite-plugin-ssr to inject
uno.css
from within a tiny JavaScript shell instead. So it’s fixable.It’s low priority though since HTML-only is more of an experiment than something people actually use.
Although technologies such as React Server Components (which also have no/minimal browser-side JavaScript) will need a solution for that. For example, chances are that UnoCSS’s HMR also doesn’t work with Hydrogen.
I think we can close this ticket in favor of https://github.com/brillout/vite-plugin-ssr/issues/411.
Thanks for the ping.
@AaronBeaudoin Unfortunately
mode: "vue-scoped"
doesn’t seem to work with Nuxt 3, which is also hinted at by TypeScript typing errors when using it withunocss
insidedefineNuxtConfig
.@antfu Thanks for the reply, I’ll do some more testing and get back with a new issue if it persists.