-
Notifications
You must be signed in to change notification settings - Fork 27.6k
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
Error with khan/aphrodite for CSS when manually reload #247
Comments
I guess the error occurs because there is no setting for server rendering of And since there is no way to add the setting, you wouldn't be able to use the library. |
@alexrqs your snippet with // pages/index.js
import React from 'react'
import css from 'next/css'
const styles = { h1: { color: 'crimson' } }
const header = () => <h1 className={css(styles.h1)}>Hola</h1>
export default header; |
@nkzawa Aphrodite does support server-side rendering. You need to wrap the server render in Aphrodite's See https://github.com/Khan/aphrodite/blob/master/README.md#server-side-rendering for more info and for instructions on how to rehydrate. |
We're going to address it with #251. I don't think wrapping is a good API though. I think all SSR modules should expose a "flush" or "rewind" API |
If the document is already open when you apply
css(styles.h1)
it takes the chages and you see the red text, but if you manually reload the browser or the application is just starting you get a500 | Internal Server Error.
and the console will give you
I get the
import style from 'next/css'
but I already have another project with aphrodite modules that I'd like to reuse.The text was updated successfully, but these errors were encountered: