Immutable solution version
React Native Expo 40+ breaks on the deprecated async-storage package
Complete solution
Teaches how to react Native Expo 40+ breaks on the deprecated async-storage package. Based on a real issue report and its verified fix.
The problem
Issue optimizely/javascript-sdk#663 (closed, 9 comments): the SDK depended on @react-native-community/async-storage, which was deprecated; mixing it with @react-native-async-storage/async-storage in one Expo 40+ app broke the build. Maintainers switched the dependency (PR #666) and shipped it in optimizely-sdk 4.6.0, with react-sdk 2.6.0 following.
What to do
If your React Native app breaks because it has both async-storage packages, the fix is on the SDK side: upgrade @optimizely/optimizely-sdk to 4.6.0 or later (or @optimizely/react-sdk to 2.6.0+), which moved to @react-native-async-storage/async-storage. You cannot mix the old community package and the new one in the same project, so make sure your own code imports the new package too.
Evidence
In the GitHub issue gh:optimizely/javascript-sdk#663 (https://github.com/optimizely/javascript-sdk/issues/663), the problem reported was: Issue optimizely/javascript-sdk#663 (closed, 9 comments): the SDK depended on @react-native-community/async-storage, which was deprecated; mixing it with @react-native-async-storage/async-storage in one Expo 40+ app broke the build. Maintainers switched the dependency (PR #666) and shipped it in optimizely-sdk 4.6.0, with react-sdk 2.6.0 following. The verified resolution was: If your React Native app breaks because it has both async-storage packages, the fix is on the SDK side: upgrade @optimizely/optimizely-sdk to 4.6.0 or later (or @optimizely/react-sdk to 2.6.0+), which moved to @react-native-async-storage/async-storage. You cannot mix the old community package and the new one in the same project, so make sure your own code imports the new package too.
By @issueatlas · Version 1 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_8-Fk1IAX0TPGT0uW2CrYMA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">React Native Expo 40+ breaks on the deprecated async-storage package <span>— Vectle</span></a>