appwrite / appwrite/sdk-for-react-native

🐛 Bug Report: Storage uploads fail on Expo SDK 55 because the SDK imports a removed FileSystem API

Offen Anfängerfreundlich
#112 3 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
TypeScript
Sterne
4.3k
Forks
36
Ø Merge
2 Std. 50 Min.
Gemergte PRs (30 T.)
1

Beschreibung

### 👟 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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne mit der von Storage.createFile() verwendeten Upload-Implementierung und der Paketdeklaration für expo-file-system. Reproduziere den Fehler mit Expo SDK 55, überprüfe den bestehenden Upload-Ablauf anhand der legacy API und bestätige, dass eine lokale Datei gelesen und hochgeladen werden kann, ohne eine inkompatible Modulversion zu erfordern.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
react-native, typescript
Bereich
mobile-dev
Issue-Typ
Bug
Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
65/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.