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

Problems with module and vite ssr #45149

Open
tyumen-777 opened this issue Jan 30, 2025 · 1 comment
Open

Problems with module and vite ssr #45149

tyumen-777 opened this issue Jan 30, 2025 · 1 comment
Assignees
Labels
bug 🐛 Something doesn't work package: system Specific to @mui/system

Comments

@tyumen-777
Copy link

tyumen-777 commented Jan 30, 2025

Steps to reproduce

Steps:

  1. Create app vite + ssr
  2. Add mui v 6.1.8 to you project

Current behavior

There is an error when we use React project + vite ssr. When we build app, we get error

Image

To escape this problem we shoud add @mui/styled-engine to ssr vite config like this
ssr: { noExternal: [ '@mui/material', '@mui/utils', '@mui/styled-engine', '@mui/icons-material', '@mui/system', 'react-countdown-circle-timer', ], },

Expected behavior

No response

Context

No response

Your environment

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Search keywords: vite, ssr

@tyumen-777 tyumen-777 added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jan 30, 2025
@zannager zannager added the package: system Specific to @mui/system label Jan 30, 2025
@DiegoAndai DiegoAndai assigned Janpot and unassigned brijeshb42 Jan 31, 2025
@DiegoAndai DiegoAndai added bug 🐛 Something doesn't work and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jan 31, 2025
@DiegoAndai
Copy link
Member

Hey @tyumen-777, thanks for the report. This is very likely the same as #43980 (comment), which will be fixed by #43264.

May I ask you to try these resolutions to confirm this?

In your package.json add:

"resolutions": {
    "@mui/icons-material": "https://pkg.csb.dev/mui/material-ui/commit/56c2982a/@mui/icons-material",
    "@mui/material": "https://pkg.csb.dev/mui/material-ui/commit/56c2982a/@mui/material",
    "@mui/styled-engine": "https://pkg.csb.dev/mui/material-ui/commit/56c2982a/@mui/styled-engine",
    "@mui/system": "https://pkg.csb.dev/mui/material-ui/commit/56c2982a/@mui/system",
    "@mui/utils": "https://pkg.csb.dev/mui/material-ui/commit/56c2982a/@mui/utils",
  },

Let us know if this fixes the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work package: system Specific to @mui/system
Projects
None yet
Development

No branches or pull requests

5 participants