-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
styled-components and gatsby-plugin-layout together causes weird behaviours #8771
Comments
@marcneander I followed the steps that you provided. But couldn't find fonts or index page chunk loading twice. Please refer screenshots below: I saw a flicker when the site is loaded, but that might be because of the fonts being loaded later. |
@kakadiadarpan Hmm, thats weird. I cleared node_modules, .cache and public dirs and reinstalled and rebuilt everything. Still get the same problems in both Firefox and Chrome. Disabling javascript will prevent the problems I'm having so something is going on when the app is being hydrated. See screenshots from |
#3067 seems like the same issue I'm having? Tried all possible solutions in that thread without any success |
@marcneander can you try clearing your browser cache and try? |
@kakadiadarpan It's not that. If you see screenshots I have "Disable cache" and you can see resources being fetched (not from cache) |
@kakadiadarpan You're serving my site with |
Turns out that the Any suggestions on how to add global styles with |
Old issues will be closed after 30 days of inactivity. This issue has been quiet for 20 days and is being marked as stale. Reply here or add the label "not stale" to keep this issue open! |
This issue is being closed due to inactivity. Is this a mistake? Please re-open this issue or create a new issue. |
The same issue here! |
+1 :( |
Description
I've been sitting for a couple of hours now trying to wrap my head around this bug I'm experiencing. I'm using
styled-components
andgatsby-plugin-layout
. In my Layout component I have my global styles where I load my fonts.However when building and serving my gatsby app, my fonts and index page chunk is loaded twice. Causing a flicker.
Removing
gatsby-plugin-layout
solved the problem but I need it for routing animation and performance when usingstyled-components
.Downgrading
styled-components
to v3 prevents fonts for being loaded twice onload. But when hovering over "View Profile" button, fonts are loaded again and causes same flickering.Seems to only happen on index route weirdly enough.
Steps to reproduce
Clone https://github.com/marcneander/marcneander.se
yarn install && yarn build && yarn serve
See my fonts and index chunk being loaded twice.
Environment
The text was updated successfully, but these errors were encountered: