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
Twin.macro emotion example flickering when build for production #32
Comments
I'll have to look into this futher - perhaps there's something to be learned in this article. |
I found that adding the import { CacheProvider } from '@emotion/react'
import { cache } from '@emotion/css'
import { GlobalStyles } from '../components/GlobalStyles'
function MyApp({ Component, pageProps }) {
return (
<CacheProvider value={cache}>
<GlobalStyles />
<Component {...pageProps} />
</CacheProvider>
)
}
export default MyApp |
@williamtetlow Could you check that your production build is working correctly after adding that? This CacheProvider was originally part of the example until I saw it caused some issues. |
@ben-rogerson so the issue I was seeing was caused by tailwind class using the I can't recreate the issue in example repo but implementation in the example repo To overcome issue with If you don't need to inline CSS in head you shouldn't include custom implementation of We should either
|
Hey william, I was wondering which option you would choose here? |
I tried this example https://github.com/ben-rogerson/twin.examples/tree/master/next-emotion
but when I build & start (for production) then go to localhost:3000 and refresh page the UI seems flickering.
It does not happen in the development mode.
After some debugging seems like calc css function not call on server-side
I guess
If you're using styled-components, emotion, goober, or something else
emotion
A link to a minimal demo showing the bug in action
fork this repo https://github.com/ben-rogerson/twin.examples/tree/master/next-emotion
and use
yarn build && yarn start
The text was updated successfully, but these errors were encountered: