I’m using a monorepo managed by Turborepo, and I recently moved my React-Admin project into it. In my standalone React-Admin setup, I didn’t need to manually install MUI (@mui/material) because it’s a dependency of React-Admin itself. However, after migrating to the Turborepo monorepo, I’m encountering issues where MUI components aren’t working unless I explicitly add @mui/material to my app’s package.json.
I expected React-Admin to bring its own MUI dependency without requiring manual installation, as it did before. I’m using pnpm as my package manager with Turborepo. Why is this happening, and how can I configure my monorepo to properly resolve React-Admin’s dependencies (like MUI) without manually adding them?
Here’s my setup:
- Turborepo version: [^2.4.4]
- Package manager: [[email protected]]
- React-Admin version: [^5.5.3]
Monorepo structure:
apps/
admin/ (my React-Admin app)
docs/
web/
packages/
I’m using a monorepo managed by Turborepo, and I recently moved my React-Admin project into it. In my standalone React-Admin setup, I didn’t need to manually install MUI (@mui/material) because it’s a dependency of React-Admin itself. However, after migrating to the Turborepo monorepo, I’m encountering issues where MUI components aren’t working unless I explicitly add @mui/material to my app’s package.json.
I expected React-Admin to bring its own MUI dependency without requiring manual installation, as it did before. I’m using pnpm as my package manager with Turborepo. Why is this happening, and how can I configure my monorepo to properly resolve React-Admin’s dependencies (like MUI) without manually adding them?
Here’s my setup:
- Turborepo version: [^2.4.4]
- Package manager: [[email protected]]
- React-Admin version: [^5.5.3]
Monorepo structure:
apps/
admin/ (my React-Admin app)
docs/
web/
packages/
Share
Improve this question
edited Mar 16 at 8:09
James Z
12.3k10 gold badges27 silver badges47 bronze badges
asked Mar 15 at 23:39
Ramin eghbalianRamin eghbalian
2,6751 gold badge21 silver badges38 bronze badges
1 Answer
Reset to default 0You are right, React Admin does bring MUI in it's own dependencies.
However I believe package managers that use PnP (namely PNPM) are more strict regarding the dependencies: if you import from, say, @mui/material
, directly in your own code, then you need to add an explicit dependency on @mui/material
. The transitive dependency through react-admin
is no longer sufficient.
Also, React Admin v5.6.4 included a fix to improve compatibility with some package managers, namely PNPM.
Does using this version help fix your issue?