GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||
GeezerVison is showing github.com — plugin-rsc: a server component's CSS is not linked in production when its module has no final newline · Issue #1495 · vitejs/vite-plugin-react DescriptionRelated pluginsDescribe the bugHi, and thank you for plugin-rsc! It made it possible for us to run the Payload CMS 4 admin panel on React Router 8's RSC Framework Mode, and the automatic CSS injection for server components has been a pleasure to rely on. We found one case where that injection silently does nothing, in production builds only: when a server component's module has no final newline and ends with a line comment, its CSS file is built and listed in the assets manifest, but no How we found it. Our admin pages rendered unstyled in production while
Every compiled file of //# sourceMappingURL=index.js.mapMinimalTemplate = /* #__PURE__ */ __vite_rsc_wrap_css__(MinimalTemplate, "MinimalTemplate"); export { MinimalTemplate }; Cause. I have opened #1494 with a fix: it adds a newline before the first moved block, only when the input does not end with one, so modules that already end with a newline produce the same output as before. I hope that is useful, and I am happy to change the approach if you prefer another one. Reproductionhttps://github.com/Mheaus/vite-plugin-rsc-final-newline-repro Steps to reproduceThe reproduction starts from
Both are loaded with pnpm install
./check.sh # vite build, vite preview, then inspects the served HTMLResult with Both cards render, but only Some notes from investigating, in case they help:
System Info System:
OS: macOS 27.0
CPU: (18) arm64 Apple M5 Pro
Memory: 1.45 GB / 48.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 26.5.0 - /opt/homebrew/bin/node
npm: 11.17.0 - /opt/homebrew/bin/npm
pnpm: 11.17.0
Browsers:
Chrome: 154.0.8037.98
Firefox: 153.0
Safari: 27.0
npmPackages:
@vitejs/plugin-react: 6.0.1 => 6.0.1
@vitejs/plugin-rsc: 0.5.36 => 0.5.36
vite: 8.3.4 => 8.3.4Also reproduced on Node 24.15.0. Used Package Managerpnpm LogsNo error is logged: the build succeeds and the page renders, only without the component's stylesheet. Validations
Thanks a lot for your time! Activity
MetadataMetadataAssigneesLabelsNo labels TypeProjectsMilestoneRelationshipsDevelopmentIssue actions | ||||||
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |