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

Import error when using Material UI styles with React router v7 framework #4675

Open
kayden1940 opened this issue Feb 13, 2025 · 6 comments · Fixed by #4686
Open

Import error when using Material UI styles with React router v7 framework #4675

kayden1940 opened this issue Feb 13, 2025 · 6 comments · Fixed by #4686
Labels

Comments

@kayden1940
Copy link

kayden1940 commented Feb 13, 2025

Steps to reproduce

Similar to this one mui/material-ui#42544
A fresh start of React router v7 framework template, installing and importing ReactRouterAppProvider yield below:

Directory import '/repo/packages/web/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected]__@emotion+styled_eyl2qwst7e3srdiktssoojso7e/node_modules/@mui/material/styles' is not supported resolving ES modules imported from /repo/packages/web/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected]__@emotion+styled_eyl2qwst7e3srdiktssoojso7e/node_modules/@toolpad/core/AppProvider/AppProvider.js Did you mean to import "@mui/material/node/styles/index.js"?
adding ssr noExternal in vite.config doesn't solve it.

Current behavior

No response

Expected behavior

No response

Context

No response

Your environment

System:
OS: macOS 15.2
Binaries:
Node: 22.8.0 - ~/.nvm/versions/node/v22.8.0/bin/node
npm: 10.8.2 - ~/.nvm/versions/node/v22.8.0/bin/npm
pnpm: 9.15.1 - ~/.nvm/versions/node/v22.8.0/bin/pnpm
Browsers:
Chrome: 133.0.6943.54
Edge: Not Found
Safari: 18.2
npmPackages:
@emotion/react: 11.14.0
@types/react: 19.0.8
react: 19.0.0
react-dom: 19.0.0
typescript: ^5 => 5.7.3

Search keywords: React router v7 framework

@kayden1940 kayden1940 added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Feb 13, 2025
@Janpot
Copy link
Member

Janpot commented Feb 17, 2025

I believe this would be solved by #4676

@Janpot
Copy link
Member

Janpot commented Feb 18, 2025

A fresh start of React router v7 framework template

@kayden1940 which template are you talking about? Can you share a github link?

@Janpot Janpot added status: waiting for author Issue with insufficient information and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Feb 18, 2025
@kayden1940
Copy link
Author

A fresh start of React router v7 framework template

@kayden1940 which template are you talking about? Can you share a github link?

https://github.com/remix-run/react-router-templates/tree/main/default

@github-actions github-actions bot added status: waiting for maintainer These issues haven't been looked at yet by a maintainer and removed status: waiting for author Issue with insufficient information labels Feb 18, 2025
@Janpot
Copy link
Member

Janpot commented Feb 19, 2025

#4686 will fix the import, but some extra setup will be needed to make sure the styles and the theme work correctly with SSR. See https://mui.com/material-ui/guides/server-rendering/

Copy link

This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

Note

@kayden1940 How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.

@github-actions github-actions bot removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Feb 21, 2025
@Janpot Janpot reopened this Mar 13, 2025
@Janpot
Copy link
Member

Janpot commented Mar 13, 2025

This is reverted until X packages are on the beta release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants