Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

[email protected] generates 2 css files with identical content #1397

Closed
Ashot-KR opened this issue Aug 12, 2020 · 12 comments · Fixed by #1415
Closed

[email protected] generates 2 css files with identical content #1397

Ashot-KR opened this issue Aug 12, 2020 · 12 comments · Fixed by #1415
Labels

Comments

@Ashot-KR
Copy link
Contributor

Ashot-KR commented Aug 12, 2020

Describe the bug
In 0.28.0 sapper generates files main.[hash].css and client.[hash].css with identical content.

To Reproduce
Create new sapper project from template

npx degit "sveltejs/sapper-template#rollup" my-app
cd my-app
npm install

Start app npm run dev
Open http://localhost:3000 in browser, open browser devtools on network/css
Screenshot 2020-08-12 at 14 34 18
main.[hash].css and client.[hash].css has identical content.

This is css files generated with [email protected] and [email protected] (UPD: added rollup version)
Screenshot 2020-08-12 at 14 33 21

Information about your Sapper Installation:

  System:
    OS: macOS 10.15.4
    CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
    Memory: 615.80 MB / 16.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 14.7.0 - /usr/local/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.14.7 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  npmPackages:
    rollup: ^2.3.4 => 2.23.1
    sapper: ^0.28.0 => 0.28.0
    svelte: ^3.17.3 => 3.24.1
@Ashot-KR
Copy link
Contributor Author

Screenshot of styles from inspector:
image

@habibrosyad
Copy link
Contributor

@Ashot-KR, what's your Rollup version with sapper v0.27.16?
If you're using Rollup v2, there was an issue here sveltejs/sapper-template#233 which was solved with the release of v0.28.

@Ashot-KR
Copy link
Contributor Author

@habibrosyad
Copy link
Contributor

Could you try downgrade your rollup version to ^1.20.0 and verify the generated CSSes? I suppose it should be identical with what you have with the current template now (sapper 0.28).

In sveltejs/sapper-template#233, prior to the template upgrade using Rollup v2, sapper generated multiple chunks of CSS instead of just one like in your screenshot for v0.27. It was a bug because of breaking changes in Rollup 2 (rollup/rollup#3655) which changed sapper's behaviour in outputting CSS. However I haven't confirmed whether between those chunks would have identical contents or not yet.

@Ashot-KR
Copy link
Contributor Author

@habibrosyad btw, with [email protected] and [email protected] there is no such files (screenshot 2 in issue description)

@habibrosyad
Copy link
Contributor

habibrosyad commented Aug 12, 2020

Yeah, that's what I mean, the behaviour changes in here sveltejs/sapper-template@b6a92e6, that's why I'm asking whether you could try to downgrade your Rollup to ^1.20.0 with [email protected]. Originally, with sapper template you should get files in screenshot 1 (which I haven't confirmed having duplicate contents or not).

@Ashot-KR
Copy link
Contributor Author

Ashot-KR commented Aug 12, 2020

@habibrosyad i meant there is no files with content duplicates.
here is result with [email protected] and [email protected]
image
image
main.[hash].css and client.[hash].css contents is identical (except of sourceMappingURL of course)

@Ashot-KR
Copy link
Contributor Author

same with [email protected] and [email protected]

@habibrosyad
Copy link
Contributor

I could confirm this also happen with [email protected] and [email protected]. I could say that sapper originally behaving that way even before v0.28. You got things in screenshot 2 because you use Rollup 2 with [email protected] which I mention as issue in sveltejs/sapper-template#233.

Need to confirm whether this behaviour is intended or not. Maybe @benmccann or @Conduitry knows better in this area.

@benmccann
Copy link
Member

No, that shouldn't happen. @ajbouh said he's currently working on reimplementing this part, so rather than debug the current version I'll probably wait to see what he comes up with

@Conduitry
Copy link
Member

Reverting #1306 seems to fix this, but that would presumably break other things.

@benmccann
Copy link
Member

benmccann commented Aug 17, 2020

I think this issue was introduced by #471, which made leftover include entry_css_modules

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
4 participants