ssr: false - Breaks all styling
See original GitHub issueDescribe the bug
Styling seems to break when npm run build && npm start
with ssr: false
.
npm start dev
appears to be fine.
To Reproduce
npm init svelte@next
ssr: false
in svelte.config.cjs
npm run build && npm start
- The output of
npx envinfo --system --npmPackages svelte,@sveltejs/kit,vite --binaries --browsers
System:
OS: macOS 11.2.2
CPU: (8) arm64 Apple M1
Memory: 373.28 MB / 8.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 15.12.0 - /opt/homebrew/bin/node
npm: 7.6.3 - /opt/homebrew/bin/npm
Browsers:
Firefox: 87.0
Safari: 14.0.3
Safari Technology Preview: 14.2
npmPackages:
@sveltejs/kit: next => 1.0.0-next.71
svelte: ^3.29.0 => 3.37.0
vite: ^2.1.0 => 2.1.5
- Your browser Firefox
- Your adapter (e.g. Node, static, Vercel, Begin, etc…) Tested on node & static
Severity How severe an issue is this bug to you? Is this annoying, blocking some users, blocking an upgrade or blocking your usage of SvelteKit entirely?
Production builds appear to be blocked for users not using ssr
Issue Analytics
- State:
- Created 2 years ago
- Reactions:7
- Comments:19 (17 by maintainers)
Top Results From Across the Web
Wrong styles applied during SSR hydration #351 - GitHub
Styled components is applying wrong styles during SSR hydration. The problem is that styles in production builds are swapped across ...
Read more >Why setting SSR to false is breaking my styles in Nextjs
I have a Nextjs app. I have used it to build the Coinbase clone. Since it uses window object to connect to metamsk,...
Read more >Why We're Breaking Up with CSS-in-JS - DEV Community
Runtime CSS-in-JS libraries work by inserting new style rules when components render, and this is bad for performance on a fundamental level. 2....
Read more >Master code splitting with dynamic imports in Next.js - Daily.dev
If the ssr is true, the code-split components are pre-rendered on the server, if false they are rendered on the client-side(i.e in the...
Read more >Docs • Svelte
Components are the building blocks of Svelte applications. They are written into .svelte files, using a superset of HTML. All three sections —...
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 FreeTop 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
Top GitHub Comments
I have the same issue with all styles disappearing with ssr: false. Rolling back to kit 1.0.0-next.65 made styles appear again.
Thanks @mattiash, can confirm rolling back to
1.0.0-next.65
has worked as a temporary fix for me as well.