0

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/

1 Answer 1

0

You 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?

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.