appwrite / appwrite/sdk-for-react-native

🐛 Bug Report: [TypeError: Cannot read property 'getItem' of undefined]

Open
#113 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
4.3k
Forks
36
Avg merge
2h 50m
Merged PRs (30d)
1

Description

### 👟 Reproduction steps

got: node_modules\react-native-appwrite\dist\esm\sdk.js file
check: window.localStorage.getItem('cookieFallback')
and run your app on actual device using realtime.onMessage

### 👍 Expected behavior

This bug is not expected to occur

### 👎 Actual Behavior

It throws an error: [TypeError: Cannot read property 'getItem' of undefined]

Call Stack
realtime.onMessage (node_modules\react-native-appwrite\dist\esm\sdk.js)
call ()
invoke (node_modules\react-native\src\private\webapis\dom\events\EventTarget.js)
dispatch (node_modules\react-native\src\private\webapis\dom\events\EventTarget.js)
dispatchEvent (node_modules\react-native\src\private\webapis\dom\events\EventTarget.js)
_eventEmitter.addListener$argument_1 (node_modules\react-native\Libraries\WebSocket\WebSocket.js)
apply ()
emit (node_modules\react-native\Libraries\vendor\emitter\EventEmitter.js)
apply ()
(node_modules\@babel\runtime\helpers\superPropGet.js)
RCTDeviceEventEmitterImpl#emit (node_modules\react-native\Libraries\EventEmitter\RCTDeviceEventEmitter.js)

### 🎲 Appwrite version

Different version (specify in environment)

### 💻 Operating system

Windows

### 🧱 Your Environment

I have development built from app running on actual android device with android version 16, and I have latest version of react-native-appwrite: 0.34.0

### 👀 Have you spent some time to check if this issue has been raised before?

- [x] I checked and didn't find similar issue

### 🏢 Have you read the Code of Conduct?

- [x] I have read the [Code of Conduct](https://github.com/appwrite/appwrite/blob/HEAD/CODE_OF_CONDUCT.md)

Contributor guide

Open the contributing guide

Research direction

Inspect node_modules/react-native-appwrite/dist/esm/sdk.js and the realtime.onMessage call path first, then reproduce on an actual Android device with react-native-appwrite 0.34.0. Done means realtime.onMessage no longer throws the getItem-of-undefined TypeError in that environment.

Written by the indexing model from the issue text.

Assessment

Tech stack
react-native, typescript
Domain
api, mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.