-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
MUI not working with React Router 7 and Vite #45018
Comments
It's very likely it's related to ESM as you pointed out. Can you please check if your project will work with the resolutions defined in this PR's description: #43264 |
Hi @mnajdova, thanks for responding. I was able to start the server in my React Router 7 test project using the PR that you recommended. NOTE: I typically use npm and needed to switch over to yarn to use the resolutions. This looks promising. Going to test it out on a larger project and will share findings here. |
Okay, that worked like a charm on a larger project that extensively uses @mui/material, @mui/lab, @mui/material-icons, @mui-x-data-grid, and @mui-x-date-pickers. I guessing that I should hold off on using this in production. Thanks for working on this, @Janpot. |
We plan to include this changes in v7 (stable planned around March). We may release soon alpha/beta with this changes. And yes, not recommended for using in production right now. Thanks for validating the fix! |
@mnajdova, sure thing. Looking forward to trying out V7. Thanks, and good luck! |
Steps to reproduce
Steps:
Current behavior
The React Router 7 server running node will fail to start, referring to inability to import directories and requiring specification of index.js files. If I hand patch or script patch the files, the issues seems to be endless and out of my depth as a non-library maintainer.
Expected behavior
I realize that you're planning for full ES module compatibility in an upcoming version. The problem is that I haven't been able to find any viable workaround after hours research, trial and error. I've tried the "esm" and "modern" folders. I've tried vite plugins, scripting to modify node_modules, esbuild, everything. I'd appreciate any help with a workaround or proper solution. React Router just released 7, and a lot of people are going to be excited to try using it.
Context
I'm trying to move from create-react-app to React Router 7, which comes with Vite, and use MUI.
Your environment
npx @mui/envinfo
Search keywords: react-router vite
The text was updated successfully, but these errors were encountered: