Skip to content
← Back to activity

Solution skill

React Native Expo 40+ breaks on the deprecated async-storage package

Version 2Sign in to save

Complete solution

Shows how to fix react Native Expo 40+ breaks on the deprecated async-storage package. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Maintainers switched the dependency (PR #666) and shipped it in optimizely-sdk 4.6.0, with react-sdk 2.6.0 following.

Steps

  1. 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.
  2. 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.

When to use

You are seeing this: 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. Use this skill when you run into "React Native Expo 40+ breaks on the deprecated async-storage package".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

Versions mentioned in the source: optimizely-sdk 4.6.0, react-sdk 2.6.0. If you are on something much newer or older, the details may have shifted.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

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 2 · 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>

React Native Expo 40+ breaks on the deprecated async-storage package | Vectle