question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Moving from CRA to Gatsby broke JSS plugins

See original GitHub issue

In create-react-app I was using react-jss because for the jss-plugin-expand plugin is not included by default. I had <StylesProvider jss={reactJss}> and all worked fine. However, now I switched to Gatsby and the exact same setup stopped working. flex: [1, 1, '70px'] is now compiled to flex: 1, 1, 70px (with commas).

import React from 'react'
import { jss } from 'react-jss'
import { StylesProvider, ThemeProvider } from '@material-ui/core/styles'
import CssBaseline from '@material-ui/core/CssBaseline'

export default function PagesLayout({children}){
  return (
    <StylesProvider jss={jss}>
      <ThemeProvider theme={theme}>
        {children}
      </ThemeProvider>
    </StylesProvider>
  )
}

The only difference I can think of, is that now this file is a wrapper, and has {children} instead of <App/>

versions:

"react-jss": "^10.3.0",
"@material-ui/core": "^4.11.0",
"react": "^16.12.0",

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
oliviertassinaricommented, Aug 14, 2020

We don’t support nor own react-jss

0reactions
oliviertassinaricommented, Aug 15, 2020

Thanks for sharing the solution!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Moving from CRA to Gatsby broke JSS plugins - Stack Overflow
In create-react-app I was using react-jss because for the jss-plugin-expand plugin is not included by default. I had <StylesProvider jss={ ...
Read more >
Moving from CRA to Gatsby broke JSS plugins #22200 - GitHub
In create-react-app I was using react-jss because for the jss-plugin-expand plugin is not included by default. I had and all worked fine.
Read more >
Porting from Create React App to Gatsby
gatsby -plugin-image will create optimized versions of your images in different sizes, loading a smaller, optimized version of an image and replacing it...
Read more >
Moving Create-React-App to Gatsby.js : r/gatsbyjs - Reddit
Hi. I have recently learnt react and created an app via Create-React-App. I would like to port it over to Gatsby.js and I'm...
Read more >
Learn how to migrate a create-react-app project to Gatsby!
Learn how to migrate a create-react-app project to Gatsby! ... Explaining Gatsby plugins; Breaking down CRA routes into pages(static and client side) ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found