Skip to content
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

When can we expect gatsby-plugin-styled-components equivalent for gatsby v3+? #30543

Closed
billyzduke opened this issue Mar 29, 2021 · 2 comments
Closed
Labels
type: bug An issue or pull request relating to a bug in Gatsby type: question or discussion Issue discussing or asking a question about Gatsby

Comments

@billyzduke
Copy link

billyzduke commented Mar 29, 2021

Description

gatsby-plugin-styled-components only works with gatsby v2, while the only apparent alternative I've been able to find, @raygesualdo/gatsby-plugin-babel-styled-components, also seemingly doesn't work for v3 (and has not been updated for 2 1/2 years). This (at least I hope it's this?) leads to extreme CSS issues after SSR site builds: my homepage, for example, shows a second or 2 of visible, very unstyled content and source images on initial load and reload, whereas this unwanted behavior is absent from dev bundle.

Steps to reproduce

  1. Upgrade to Gatsby v3
  2. Attempt to use styled-components
    http://react.wrongwindows.rocks/

Expected result

Loading a page from the SSR build should behave identically to the same page from the dev build

Actual result

CSS is janked/borked/delayed, with ugly unstyled content visible to user before styles are applied.

Environment

(Since neither of the above-mentioned plugins seems to do anything, I have already removed both from my package.json and gatsby-config.js)

System:
OS: macOS 10.15.7
CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 15.8.0 - /usr/local/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 7.5.1 - /usr/local/bin/npm
Languages:
Python: 2.7.16 - /usr/bin/python
Browsers:
Edge: 89.0.774.63
npmPackages:
gatsby: ^3.1.2 => 3.1.2
gatsby-alias-imports: ^1.0.6 => 1.0.6
gatsby-plugin-image: ^1.1.2 => 1.1.2
gatsby-plugin-postcss: ^4.1.0 => 4.1.0
gatsby-plugin-react-helmet: ^4.1.0 => 4.1.0
gatsby-plugin-sanity-image: ^0.6.0 => 0.6.0
gatsby-plugin-sharp: ^3.1.2 => 3.1.2
gatsby-source-sanity: ^7.0.0 => 7.0.0
gatsby-transformer-sharp: ^3.1.0 => 3.1.0
npmGlobalPackages:
gatsby-cli: 2.19.1

@billyzduke billyzduke added the type: bug An issue or pull request relating to a bug in Gatsby label Mar 29, 2021
@gatsbot gatsbot bot added type: question or discussion Issue discussing or asking a question about Gatsby status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Mar 29, 2021
@LekoArts LekoArts removed the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Apr 6, 2021
@LekoArts
Copy link
Contributor

LekoArts commented Apr 6, 2021

The latest version of gatsby-plugin-styled-components is working perfectly fine with Gatsby v3:

image

It must be a user error in your site but if you can provide a minimal reproduction that would indicate a bug in Gatsby please create a new issue. Thanks!

@LekoArts LekoArts closed this as completed Apr 6, 2021
@billyzduke
Copy link
Author

No user error in my site, actually just didn't realize at first that there was an updated version of the plugin available. Because I was looking at this page, which still says "support [sic] Gatsby v2 only": https://www.gatsbyjs.com/plugins/gatsby-plugin-styled-components/

KyleAMathews added a commit that referenced this issue Apr 10, 2021
vladar pushed a commit that referenced this issue Apr 12, 2021
…on (#30806)

* fix(gatsby-plugin-styled-components): Add note about version release

As noted in #30543 (comment) — the v4 release isn't mentioned.

* Update README.md

Co-authored-by: Lennart <lekoarts@gmail.com>
gatsbybot added a commit to gatsbyjs/gatsby-starter-theme that referenced this issue Apr 12, 2021
…on (#30806)

* fix(gatsby-plugin-styled-components): Add note about version release

As noted in gatsbyjs/gatsby#30543 (comment) — the v4 release isn't mentioned.

* Update README.md

Co-authored-by: Lennart <lekoarts@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug An issue or pull request relating to a bug in Gatsby type: question or discussion Issue discussing or asking a question about Gatsby
Projects
None yet
Development

No branches or pull requests

2 participants