cli: react-native link @react-native-community/async-storage fails

Environment

info 
  React Native Environment Info:
    System:
      OS: macOS High Sierra 10.13.6
      CPU: (4) x64 Intel(R) Core(TM) i5-4278U CPU @ 2.60GHz
      Memory: 352.69 MB / 16.00 GB
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 11.12.0 - /usr/local/bin/node
      Yarn: 1.15.2 - /usr/local/bin/yarn
      npm: 6.7.0 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
    IDEs:
      Android Studio: 3.3 AI-182.5107.16.33.5199772
      Xcode: 10.1/10B61 - /usr/bin/xcodebuild
    npmPackages:
      react: ^16.6.3 => 16.8.5 
      react-native: ^0.59.2 => 0.59.2 
    npmGlobalPackages:
      react-native-cli: 2.0.1
      react-native-git-upgrade: 0.2.7

Description

The link in this new lib fails. The commands states to to log a bug:

$ react-native link @react-native-community/async-storage
info Linking "@react-native-community/async-storage" iOS dependency
error Something went wrong while linking. Error: Cannot read property 'match' of undefined 
Please file an issue here: https://github.com/react-native-community/react-native-cli/issues
error Cannot read property 'match' of undefined

Reproducible Demo

react-native link @react-native-community/async-storage

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 42 (21 by maintainers)

Most upvoted comments

@berdyshev I have found a workaround. react-native-asset module ( https://www.npmjs.com/package/react-native-asset ) made the deal!

Yes, you need to run react-native link after that to make linking happen

Thanks for posting this! I can see the code is designed to expect this line which is very weird design choice. It could be named better, like “DO NOT REMOVE. THIS IS FOR CLI POD INTEGRATION TO WORK” or so. Maybe we can squeeze the change to 0.60.

I’ll have to admit, “error Something went wrong while linking.” is not the greatest error message. It seems like the stack trace is eaten. Perhaps we could start by displaying the full stack trace of the fatal error message and see what object “matched” is called on.

Let me see if I can re-create it outside an my private project.