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.

Doesn't load material-ui v5.0.0-alpha.38 theme on server with nextjs

See original GitHub issue

I followed the proposed example: https://github.com/mui-org/material-ui/tree/next/examples/nextjs

This is the code of the theme, where I call dark

import { createTheme } from '@material-ui/core/styles';
const theme = createTheme({
    palette: {
        mode: "dark",
        
      },
});
export default theme;

And the material-ui issue does load on the client, but as seen in the image not on the server alt text

Prepare an example, if you inspect the element in the network section, select the first element and then in preview, you can see that it is not loading material-ui on the server only on the client

https://codesandbox.io/s/0uo7r?file=/pages/index.js https://0uo7r.sse.codesandbox.io/

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
Harshita-Kanalcommented, Jul 16, 2021

Can I work on this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

[examples] cache.compat = true flickering when outside the ...
Clone example nextjs repository; Place any Material-UI component outside ... Doesn't load material-ui v5.0.0-alpha.38 theme on server with ...
Read more >
Server-side rendering broken after upgrading to MUI 5 (with ...
I launched the official SSR Next.js implementation. It showed it doesn't work either. Server-side rendering with JavaScript disabled. For more ...
Read more >
Setup Material UI With Next.js Typescript - YouTube
jsIn this video we will setup Material UI to work with Next.js Typescript project with client and server side rendering.Starter P...
Read more >
Getting started with MUI and Next.js - LogRocket Blog
Configuring MUI and Next.js to work together takes a bit more effort than you may initially think. Learn how to properly start with...
Read more >
mui/material/CHANGELOG.md - UNPKG
The CDN for @mui/material.
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