-
Notifications
You must be signed in to change notification settings - Fork 4
Closed
Description
Description
@ordercloud/react-sdk uses @react-native-async-storage/async-storage@2.1.2 to persist TanStack query state.
This package pulls in react-native@0.78.0, which has a strict peerDependency on react@"^19.0.0".
React 18 apps cannot satisfy this dependency without risking compatibility or overriding constraints via --legacy-peer-deps or patching.
Steps to Reproduce:
- Set up a project using React 18 and @ordercloud/react-sdk.
- Delete package-lock.json and node_modules.
- Run npm install.
- Observe ERESOLVE or peer dependency warnings related to react-native expecting React 19.
Here's my example in Accelerator storefront:
npm WARN While resolving: react-native@0.78.0
npm WARN Found: react@18.3.1
npm WARN Could not resolve dependency:
npm WARN peer react@"^19.0.0" from react-native@0.78.0
npm WARN node_modules/@ordercloud/react-sdk/node_modules/react-native
npm WARN peer react-native@"^0.0.0-0 || >=0.65 <1.0" from @react-native-async-storage/async-storage@2.1.2
npm WARN node_modules/@ordercloud/react-sdk/node_modules/@react-native-async-storage/async-storage
npm WARN 1 more (@react-native/virtualized-lists)
npm WARN
npm WARN Conflicting peer dependency: react@19.0.0
npm WARN node_modules/react
npm WARN peer react@"^19.0.0" from react-native@0.78.0
npm WARN node_modules/@ordercloud/react-sdk/node_modules/react-native
npm WARN peer react-native@"^0.0.0-0 || >=0.65 <1.0" from @react-native-async-storage/async-storage@2.1.2
npm WARN node_modules/@ordercloud/react-sdk/node_modules/@react-native-async-storage/async-storage
npm WARN 1 more (@react-native/virtualized-lists)
Possible Solutions
1. Refactor react-native storage:
- Refactor the SDK’s query.ts file to use browser-native localStorage or a storage that uses async-storage.
- This removes the need for @react-native-async-storage/async-storage and react-native entirely.
2. Lock the version
- Lock @react-native-async-storage/async-storage to 2.0.x, which does not have a strictly require react 19.
robertsoniv
Metadata
Metadata
Assignees
Labels
No labels