sveltejs / kit

web development, streamlined
https://svelte.dev/docs/kit
MIT License
18.73k stars 1.95k forks source link

css not loading/loading too late (SASS) #7873

Closed offeex closed 36 minutes ago

offeex commented 1 year ago

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

offeex commented 1 year ago

found out that this line breaks everything (SASS) image

I need to use in css animations like this image

Again, that happens only in preview/production, not in dev

adealmeida-aa commented 1 year ago

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. image

My dependencies aren't even super complicated: image

adealmeida-aa commented 1 year ago

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

jakobbouchard commented 1 year ago

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.

jakobbouchard commented 1 year ago

I can confirm that removing PostCSS and using plain CSS fixes the issue.

vdawg-git commented 1 year ago

I am using PostCss and Sass (separate components) and I have this problem too

eltigerchino commented 36 minutes ago

Closing this issue as it's stale and the reproduction is no longer accessible