Skip to content

Conversation

hi-ogawa
Copy link
Contributor

@hi-ogawa hi-ogawa commented Sep 14, 2025

Description

This allows removing stylesheet link via hmr but it turned out adding that back via <link /> in server component is not working likely because React tries to avoid re-inserting the same link.

Hmm, it looks like we already intentionally avoid adding ?t= to link href.

// this doesn't include ?t= query so that RSC <link /> won't keep adding styles.
const hrefs = [...cssIds].map((id) =>
normalizeViteImportAnalysisUrl(environment, id),
)

Created a new issue for now #850

TODO

@hi-ogawa hi-ogawa merged commit 4ae3f18 into main Sep 17, 2025
20 checks passed
@hi-ogawa hi-ogawa deleted the 09-14-fix_rsc_remove_server_style_when_css_import_is_removed branch September 17, 2025 03:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

remove server style when css import is removed
1 participant