最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

React-Admin Dependency Issue in Turborepo Monorepo: MUI, emotion and etc... Not Resolved - Stack Overflow

programmeradmin2浏览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/

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
Add a comment  | 

1 Answer 1

Reset to default 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?

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论