Skip to content

Web: Example app is broken #472

Closed
@tido64

Description

@tido64

Current behavior

It seems like the web example got broken at some point. When I run start:web, I get the following error message:

Module not found: Can't resolve '@react-native-async-storage/async-storage'

in both async-storage/example/examples/GetSetClear.js and async-storage/example/examples/MergeItem.js. When I tried changing the import to ../src/index, I got a little further but hit this instead:

Unhandled Rejection (TypeError): Cannot read property 'getItem' of undefined
GetSet.componentWillMount$
/~/example/examples/GetSetClear.js:29
  26 | };
  27 | 
  28 | async componentWillMount() {
> 29 |   const storedNumber = await AsyncStorage.getItem(STORAGE_KEY);
     |                                           ^
  30 |   if (storedNumber) {
  31 |     this.setState({
  32 |       storedNumber,

Expected behavior

yarn start:web should work out of box.

Repro steps

  1. yarn
  2. yarn start:web

Environment

  • Async Storage version: master

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions