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

Some CSS Missing since 0.28.1 #1446

Closed
benmccann opened this issue Aug 26, 2020 · 7 comments · Fixed by #1452
Closed

Some CSS Missing since 0.28.1 #1446

benmccann opened this issue Aug 26, 2020 · 7 comments · Fixed by #1452
Assignees

Comments

@benmccann
Copy link
Member

Reproduction 1
https://github.com/juho/sapper-rollup-css-strip

Reproduction 2
On Sapper v0.28.0: https://svelte-materialify.vercel.app/components/alerts/
On Sapper v0.28.2: https://svelte-materialify-g0c0gdngr.vercel.app/components/alerts/

Alert styles aren't being rendered. This is the scss file: https://github.com/TheComputerM/svelte-materialify/blob/sapper%400.28.1/packages/svelte-materialify/src/components/Alert/Alert.scss

Additional Info
Components which are not part of the _layout.svelte or are not included by components in _layout.svelte do not have their CSS generated.
Meaning components only included in routes do not have their CSS generated

@benmccann benmccann added the bug label Aug 26, 2020
@antony
Copy link
Member

antony commented Aug 26, 2020

That's why I couldn't recreate the issue!

@juho
Copy link
Contributor

juho commented Aug 26, 2020

adding these in rollup config makes the repro work:
preserveEntrySignatures: false in the client section and preserveEntrySignatures: "strict" in the server section

@Jayphen
Copy link
Contributor

Jayphen commented Aug 26, 2020

You can reproduce this by cloning the default sapper template and removing preserveEntrySignatures from the rollup conf

I made a repro here: Jayphen/sapper-preload-repro#1 and deployed it here https://sapper-preload-repro-git-broken-css.jayphen.vercel.app/blog/why-the-name

@TheComputerM
Copy link
Contributor

TheComputerM commented Aug 27, 2020

Here is the repo for the reproduction of Reproduction 2 in the first comment by benmccann : https://github.com/TheComputerM/sapper-bug

I also suspect it might be due to dynamic imports and using svelte:component

@benmccann
Copy link
Member Author

Thanks. I can reproduce using juho/sapper-rollup-css-strip. I don't have yarn installed and have never used it so I will use juho/sapper-rollup-css-strip to test since TheComputerM/sapper-bug is heavily reliant on yarn

@TheComputerM
Copy link
Contributor

@benmccann I have updated my repo to use npm.

@kaipaysen
Copy link

A Workaround would be to add the component to _layout.svelte and wrap it within display:none like this:

<!-- workaround until https://github.com/sveltejs/sapper/issues/1446 is fixed -->
<div style="display: none">
    <KontaktBar />
</div>

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

Successfully merging a pull request may close this issue.

6 participants