NativeKeel ยท React Native fixes

expo-file-system File.write() is async in Expo SDK 58

Updated 2026-10-23

Expo SDK 58 changed the File class of expo-file-system. The release notes list it under breaking changes: "File.write() is now async and returns a promise; use File.writeSync() for the previous behavior." They also deprecate File.md5 in favour of File.digest().

Why it is easy to miss. In SDK 57, write() returned void; in SDK 58 it returns Promise<void>. Calling a function that returns a promise without await is still valid TypeScript, so the project compiles and nothing warns you. What changes is behaviour:

Fix. Await the write, or keep the old synchronous behaviour where you depend on it:

const file = new File(Paths.document, 'cache.json');

- file.write(JSON.stringify(data));
- upload(file.uri);
+ await file.write(JSON.stringify(data));
+ upload(file.uri);

// or, where the call must stay synchronous:
+ file.writeSync(JSON.stringify(data));

For checksums, File.md5 still works but is deprecated. Its replacement is a promise too, and supports more algorithms (MD5, SHA-1, SHA-256, SHA-384, SHA-512):

- const hash = file.md5;
+ const hash = await file.digest('MD5');

To find calls that drop a promise anywhere in the project, the @typescript-eslint/no-floating-promises lint rule reports them.

Check before you upgrade. npx nativekeel upgrade lists the files that write with the expo-file-system File class or read .md5 when your app is below Expo SDK 58, with the other breaking changes between your SDK and the newest one. In our scan of 947 open-source React Native apps, 65 that are still below SDK 58 use them.

Check your whole app in one command: npx nativekeel
Free, runs locally (your code is not uploaded), no account. It reports this along with the other upgrade, store, crash and security problems it checks for.
Rather hand the upgrade over? The engineer behind NativeKeel takes on a few upgrades at a time: send your report to hello@nativekeel.com for a fixed quote.

Sources