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 #45300

Open
Tracked by #43938
kayden1940 opened this issue Feb 13, 2025 · 5 comments
Open
Tracked by #43938
Assignees
Labels

Comments

@kayden1940
Copy link

kayden1940 commented Feb 13, 2025

Steps to reproduce

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

Directory import '/repo/packages/web/node_modules/.pnpm/@toolpad+core@0.12.0_@emotion+react@11.14.0_@types+react@19.0.8_react@19.0.0__@emotion+styled_eyl2qwst7e3srdiktssoojso7e/node_modules/@mui/material/styles' is not supported resolving ES modules imported from /repo/packages/web/node_modules/.pnpm/@toolpad+core@0.12.0_@emotion+react@11.14.0_@types+react@19.0.8_react@19.0.0__@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, toolpad

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

@kayden1940 can you share the @toolpad and @mui package versions?

@Janpot is this a duplicate of #45281?

@aarongarciah aarongarciah changed the title [system] Import error when using Material UI styles with React router v7 framework Import error when using Material UI styles with React router v7 framework Feb 14, 2025
@Janpot
Copy link
Member

Janpot commented Feb 14, 2025

@Janpot is this a duplicate of #45281?

likely, yes. @kayden1940 can you try with @mui/material@next and see if it still reproduces? in the meantime I'm also opening mui/toolpad#4676

@Janpot Janpot mentioned this issue Feb 14, 2025
30 tasks
@zannager zannager added the v7.x label Feb 14, 2025
@kayden1940
Copy link
Author

@kayden1940 can you share the @toolpad and @mui package versions?

@Janpot is this a duplicate of #45281?

"@toolpad/core": "^0.12.0", "@mui/material": "^6.4.4",

@kayden1940
Copy link
Author

@Janpot is this a duplicate of #45281?

likely, yes. @kayden1940 can you try with @mui/material@next and see if it still reproduces? in the meantime I'm also opening mui/toolpad#4676

doesn't solve it using "@mui/material": "7.0.0-alpha.1"

@Janpot
Copy link
Member

Janpot commented Feb 14, 2025

@kayden1940 kindly request you to provide a stackblitz with a reproduction.

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

No branches or pull requests

4 participants