appwrite / appwrite/sdk-for-react-native
🐛 Bug Report: Storage uploads fail on Expo SDK 55 because the SDK imports a removed FileSystem API
- Lingua principale
- TypeScript
- Stelle
- 4.3k
- Fork
- 36
- Merge medio
- 2h 50m
- PR unite (30g)
- 1
Descrizione
### 👟 Reproduction steps
1. Create an Expo SDK 55 application with these dependencies:
```json
{
"expo": "55.0.3",
"expo-file-system": "55.0.9",
"react-native": "0.83.2",
"react-native-appwrite": "0.34.0"
}
```
2. Upload a local file using `Storage.createFile()`.
`react-native-appwrite` imports:
```ts
import * as FileSystem from 'expo-file-system'
```
Its upload implementation then calls:
```ts
FileSystem.readAsStringAsync(...)
```
A minimal runtime reproduction is:
```ts
import * as FileSystem from 'expo-file-system'
await FileSystem.readAsStringAsync('file:///path/to/file')
```
### 👍 Expected behavior
`react-native-appwrite` should support the current Expo FileSystem version permitted by its `expo: "*"` peer dependency, and `Storage.createFile()` should read and upload the selected file.
The SDK should not require an obsolete second version of an Expo native module.
### 👎 Actual Behavior
Expo FileSystem 55 keeps `readAsStringAsync` only under `expo-file-system/legacy`. Importing it from the top-level module produces this runtime error:
```text
Method readAsStringAsync imported from "expo-file-system" is deprecated.
You can migrate to the new filesystem API using "File" and "Directory"
classes or import the legacy API from "expo-file-system/legacy".
```
Consequently, native Appwrite Storage uploads cannot read the file.
`react-native-appwrite@0.34.0` still declares:
```json
{
"expo-file-system": "18.*.*"
}
```
Changing the SDK import to the following fixes the existing upload implementation on Expo SDK 55:
```ts
import * as FileSystem from 'expo-file-system/legacy'
```
Longer-term, the upload implementation could migrate to Expo’s current `File` API. The package should also declare a supported Expo/FileSystem compatibility range rather than depending directly on version 18 while accepting every Expo version.
Related issues cover the original FileSystem integration and earlier Expo upgrades, but not this SDK 55 API incompatibility:
- https://github.com/appwrite/sdk-for-react-native/issues/1
- https://github.com/appwrite/sdk-for-react-native/issues/45
- https://github.com/appwrite/sdk-for-react-native/issues/54
### 🎲 Appwrite version
Different version — Appwrite Cloud. The error occurs locally before the upload request reaches Appwrite.
### 💻 Operating system
MacOS development host; Expo native application targeting iOS.
### 🧱 Your Environment
- Expo SDK: `55.0.3`
- Expo FileSystem: `55.0.9`
- React Native: `0.83.2`
- React: `19.2.0`
- React Native Appwrite SDK: `0.34.0`
- Bun: `1.3.1`
- Expo SDK 55 New Architecture
- [x] I checked and didn't find a similar issue.
- [x] I have read the Code of Conduct.
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia con l’implementazione dell’upload utilizzata da Storage.createFile() e con la dichiarazione del pacchetto per expo-file-system. Riproduci il malfunzionamento con Expo SDK 55, verifica il flusso di upload esistente rispetto alla legacy API e conferma che un file locale possa essere letto e caricato senza richiedere una versione incompatibile del modulo.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- react-native, typescript
- Ambito
- mobile-dev
- Tipo di issue
- Bug
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 65/100