-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
SSR example is not working on production build #12077
Comments
Check out https://github.com/mui-org/material-ui/tree/master/examples/ssr. This is the reference implementation of the Server Rendering tutorial. |
This is the issue this example is not working @oliviertassinari |
@frenkelor The demo doesn't mean to demonstrate how to configure the production env, but sure, why not. Do you want to submit a pull request with the following change? /examples/ssr/webpack.config.js const path = require('path');
module.exports = {
entry: './client.js',
output: {
path: path.resolve(__dirname, 'build'),
filename: 'bundle.js',
publicPath: '/',
},
+ mode: process.env.NODE_ENV || 'development',
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
},
],
},
}; Thanks |
the above change did not solve this issue for me, once the client side takes over material ui does not initialize. An example: https://www.borislav.win/ |
yes you are right @opmftw you need to change the npm start command too: |
@frenkelor Perfect 👌 |
SSR example is not working while running
NODE_ENV=production npm start
I'm having the same issue on my production build
Warning: Prop
className
did not match. Server: "jss15 jss19 jss32" Client: "MuiTypography-root-15 MuiTypography-display1-19 MuiTypography-gutterBottom-32"Expected Behavior
Server and client will render without braking the ui
Current Behavior
client-side rendering brakes the ui
Steps to Reproduce (for bugs)
npm install
NODE_ENV=production npm start
The text was updated successfully, but these errors were encountered: