kit
kit copied to clipboard
css not loading/loading too late (SASS)
Describe the bug
Repro: https://github.com/OffeeX/sindrom-svelt-kita you will fiind out css being not loaded until CTRL + F5, or loaded incompletely Have this issue only ini PRODUCTION or preview mode Tested on chrome and firefox
Reproduction
I don't know i'm only one experiencing this. Similar issue: https://github.com/sveltejs/kit/issues/967
Logs
No response
System Info
System:
OS: Linux 5.15 Ubuntu 22.04.1 LTS 22.04.1 LTS (Jammy Jellyfish)
CPU: (12) x64 AMD Ryzen 5 5600H with Radeon Graphics
Memory: 2.95 GB / 15.48 GB
Container: Yes
Shell: 5.1.16 - /bin/bash
Binaries:
Node: 18.10.0 - ~/.nvm/versions/node/v18.10.0/bin/node
npm: 8.19.2 - ~/.nvm/versions/node/v18.10.0/bin/npm
Browsers:
Brave Browser: 106.1.44.112
Firefox: 107.0
npmPackages:
@sveltejs/adapter-node: 1.0.0-next.100 => 1.0.0-next.100
@sveltejs/kit: next => 1.0.0-next.551
svelte: ^3.44.0 => 3.52.0
vite: ^3.2.4 => 3.2.4
Severity
blocking all usage of SvelteKit
Additional Information
No response
found out that this line breaks everything (SASS)

I need to use in css animations like this

Again, that happens only in preview/production, not in dev
I'm experiencing a similar issue but I'm not using the random function, I'm using random to generate the stars for the background of my application.

My dependencies aren't even super complicated:

I realized this has a lot to do with the fact that vite's cssCodeSplit option is something we can't manipulate. It would be fine if we can just output all the CSS used in SvelteKit to a single .css file when using the Node adapter...
I seem to be experiencing a similar issue with PostCSS. Since my project is relatively new, I'll try removing PostCSS to see if the issue disappears.
I can confirm that removing PostCSS and using plain CSS fixes the issue.
I am using PostCss and Sass (separate components) and I have this problem too