question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Classes not re-generating without full server restart in SSR frameworks

See original GitHub issue

Minimal 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:closed
  • Created a year ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
brilloutcommented, Aug 6, 2022

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.

0reactions
alpingcommented, Aug 8, 2022

@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 with unocss inside defineNuxtConfig.

@antfu Thanks for the reply, I’ll do some more testing and get back with a new issue if it persists.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found