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

CssInJs is not working with static export #9221

Closed
Tokenyet opened this issue Oct 28, 2019 · 3 comments
Closed

CssInJs is not working with static export #9221

Tokenyet opened this issue Oct 28, 2019 · 3 comments

Comments

@Tokenyet
Copy link

Tokenyet commented Oct 28, 2019

System information

  • OS: Winodws
  • Version of Next.js: 8.0.6

I just publish a site that used cssinjs with Nextjs. The static export store class and property in someway, but I used cssinjs, so there is a conflict with the online page.

Here is the site:
https://minecraftscepter.github.io/

It would be correct about 0.5 sec, but going wrong on stable state. In my test, I stop quickly to see the class makeStyles-grow-9 is working great, but simply missing when stable. (Header part)

Open console to see the log with CssInJs, that print jss9, and then I replace makeStyles-grow-9 with jss9, everything is working as expected.

It's a bit strange that everything works in local (npm run dev or serve static files), but not online, Hope you got what I described, and thanks for taking a look.

The first 0.1 sec:
image

The stable state:
image

The css generated by cssinjs:
image

serve static files (which is jss, not the prefix of makestyle):
image

@Tokenyet
Copy link
Author

Sorry for metion here, It might be materialui's problem mui/material-ui#18018.

@Tokenyet
Copy link
Author

It's fine now, based on a large number of configureation test, I sloved It with disable the removed server-side css in _app.tsx, and used createGenerateClassName with disableGlobal to prevent removing correct initialization...

@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants