-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Description
What you were expecting:
Able to use pnpm, next, react-admin v5 (and associated ra-* libraries) with react 19 without conflicting star exports
What happened instead:
react-admin is exporting * from two libraries. When these libraries resolve to different module graphs, we get conflicting names as both have some of the same symbol names.
export * from 'ra-core';
export * from 'ra-ui-materialui';
Steps to reproduce:
I think having any other ra- library which has ra-core as a dependency this issue will show up. I have ra-data-graphql-simple and ra-data-simple-rest
> pnpm why ra-core
dependencies:
ra-data-graphql-simple 5.13.5
├── ra-core 5.13.5 peer
└─┬ ra-data-graphql 5.13.5
└── ra-core 5.13.5 peer
ra-data-simple-rest 5.13.5
└── ra-core 5.13.5 peer
react-admin 5.13.5
├── ra-core 5.13.5
├─┬ ra-i18n-polyglot 5.13.5
│ └── ra-core 5.13.5
├─┬ ra-language-english 5.13.5
│ └── ra-core 5.13.5
└─┬ ra-ui-materialui 5.13.5
└── ra-core 5.13.5 peer
Other information:
ESM spec forbids ambiguous star re-exports
Fixes tried:
- adding public-hoist-patterns in
.npmrc - adding overrides to pnpm dependencies
While using chatgqt, it came back with this statement if it helps:
React-Admin v5 is theoretically compatible with React 19, but practically incompatible with pnpm + Next.js ESM in real-world apps that don’t flatten dependencies.
Environment
- React-admin version: 5.13.5
- Last version that did not exhibit the issue (if applicable): 4.16.20
- React version: 19.2.0
- Browser: n/a
- Stack trace (in case of a JS error):
Failed to compile.
../../node_modules/.pnpm/react-admin@5.13.5_@mui+system@7.3.7_@emotion+react@11.14.0_@types+react@19.2.2_react@1_3af0b9fad750b86c67c9d296264da531/node_modules/react-admin/dist/index.js
The requested module 'ra-ui-materialui' contains conflicting star exports for the names 'ArrayInputContext', 'FilterContext', 'SimpleFormIteratorContext', 'SimpleFormIteratorItemContext', 'UserMenuContext', 'UserMenuContextProvider', 'sanitizeFieldRestProps', 'sanitizeInputRestProps', 'useArrayInput', 'useSimpleFormIterator', 'useSimpleFormIteratorItem', 'useUserMenu' with the previous requested module 'ra-core'
Import trace for requested module:
../../node_modules/.pnpm/react-admin@5.13.5_@mui+system@7.3.7_@emotion+react@11.14.0_@types+react@19.2.2_react@1_3af0b9fad750b86c67c9d296264da531/node_modules/react-admin/dist/index.js
./pages/list/graphql/admin-app.tsx