mui / material-ui

Material UI: Ready-to-use foundational React components, free forever. It includes Material UI, which implements Google's Material Design.
https://mui.com/material-ui/
MIT License
92.76k stars 31.95k forks source link

I have too many style tags in my head tag #42816

Closed Jasermon closed 3 weeks ago

Jasermon commented 3 weeks ago

Steps to reproduce

Link to live example: https://ocasoyali.com/

Steps:

  1. Go to link.
  2. Open DevTools
  3. Look at the head tag.

Current behavior

There are many style tags on production mode.

image

Expected behavior

According to what I researched, this behavior should only occur in development mode. But for some reason I don't know, my project is also in production mode.

Context

It would actually be nice if it looked like this.

image

Your environment

npx @mui/envinfo ``` Chrome 126.0.6478.127 System: OS: Windows 10 10.0.19045 Binaries: Node: 21.1.0 - C:\Program Files\nodejs\node.EXE npm: 10.2.5 - ~\AppData\Roaming\npm\npm.CMD pnpm: Not Found Browsers: Chrome: 126.0.6478.127 Edge: Chromium (126.0.2592.81) npmPackages: @emotion/react: ^11.11.4 => 11.11.4 @emotion/styled: ^11.11.5 => 11.11.5 @mui/base: 5.0.0-beta.40 @mui/core-downloads-tracker: 5.15.15 @mui/icons-material: ^5.15.14 => 5.15.15 @mui/material: ^5.15.14 => 5.15.15 @mui/private-theming: 5.15.14 @mui/styled-engine: 5.15.14 @mui/styled-engine-sc: ^6.0.0-alpha.18 => 6.0.0-alpha.18 @mui/system: 5.15.15 @mui/types: 7.2.14 @mui/utils: 5.15.14 @types/react: 18.3.1 react: ^18 => 18.3.1 react-dom: ^18 => 18.3.1 styled-components: ^6.1.8 => 6.1.8 ```

Search keywords: style tags

Jasermon commented 3 weeks ago

https://mui.com/material-ui/integrations/nextjs/#pages-router

After following the steps in this link the problem was fixed.