question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to resolve module `AccessibilityInfo` on 0.57.2 iOS

See original GitHub issue

Environment

  React Native Environment Info:
    System:
      OS: macOS Sierra 10.12.6
      CPU: x64 Intel(R) Core(TM) i5 CPU       M 540  @ 2.53GHz
      Memory: 26.35 MB / 8.00 GB
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 9.9.0 - /usr/local/bin/node
      Yarn: 1.3.2 - /usr/local/bin/yarn
      npm: 3.10.10 - /usr/local/bin/npm
      Watchman: 4.7.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 11.2, macOS 10.13, tvOS 11.2, watchOS 4.2
      Android SDK:
        Build Tools: 23.0.1, 23.0.2, 23.0.3, 24.0.0, 25.0.0, 25.0.1, 25.0.2, 25.0.3, 26.0.0, 26.0.1, 26.0.2, 26.0.3, 27.0.0, 27.0.1, 27.0.2, 27.0.3
        API Levels: 23, 24, 25, 26, 27
    IDEs:
      Xcode: 9.2/9C40b - /usr/bin/xcodebuild
    npmPackages:
      react: 16.5.0 => 16.5.0
      react-native: 0.57.2 => 0.57.2
    npmGlobalPackages:
      react-native-cli: 2.0.1
      react-native-create-library: 3.1.2
      react-native-git-upgrade: 0.2.7
      react-native-rename: 2.2.2

Description

Upgraded from 0.48.3 to 0.57.2 and on iOS building code throws error unable to resolve module AccessibilityInfo. Android works fine. This issue was resolved in 0.56.1 according to the bugs I saw in the issue list but I am still facing this issue hence opened a new one.

error: bundling failed: Error: Unable to resolve module `AccessibilityInfo` from `/Users/harkirat/wealthy/bumblebee-new/node_modules/react-native/Libraries/react-native/react-native-implementation.js`: Module `AccessibilityInfo` does not exist in the Haste module map

This might be related to https://github.com/facebook/react-native/issues/4968
To resolve try the following:
  1. Clear watchman watches: `watchman watch-del-all`.
  2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.
  3. Reset Metro Bundler cache: `rm -rf /tmp/metro-bundler-cache-*` or `npm start -- --reset-cache`.
  4. Remove haste cache: `rm -rf /tmp/haste-map-react-native-packager-*`.
    at ModuleResolver.resolveDependency (/Users/harkirat/wealthy/bumblebee-new/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:209:1301)
    at ResolutionRequest.resolveDependency (/Users/harkirat/wealthy/bumblebee-new/node_modules/metro/src/node-haste/DependencyGraph/ResolutionRequest.js:83:16)
    at DependencyGraph.resolveDependency (/Users/harkirat/wealthy/bumblebee-new/node_modules/metro/src/node-haste/DependencyGraph.js:222:485)
    at Object.resolve (/Users/harkirat/wealthy/bumblebee-new/node_modules/metro/src/lib/transformHelpers.js:149:25)
    at dependencies.map.result (/Users/harkirat/wealthy/bumblebee-new/node_modules/metro/src/DeltaBundler/traverseDependencies.js:316:29)
    at Array.map (<anonymous>)
    at resolveDependencies (/Users/harkirat/wealthy/bumblebee-new/node_modules/metro/src/DeltaBundler/traverseDependencies.js:312:16)
    at /Users/harkirat/wealthy/bumblebee-new/node_modules/metro/src/DeltaBundler/traverseDependencies.js:169:33
    at Generator.next (<anonymous>)
    at step (/Users/harkirat/wealthy/bumblebee-new/node_modules/metro/src/DeltaBundler/traverseDependencies.js:271:307)

Following is the list of devDependencies in package.json

  "devDependencies": {
    "@babel/cli": "^7.0.0",
    "@babel/core": "^7.0.0",
    "@babel/plugin-proposal-decorators": "^7.1.2",
    "babel-core": "^7.0.0-bridge.0",
    "babel-eslint": "7.1.1",
    "babel-jest": "18.0.0",
    "babel-loader": "^8.0.4",
    "babel-plugin-transform-remove-console": "6.8.5",
    "babel-preset-react-native": "4.0.0",
    "eslint": "3.13.1",
    "eslint-config-eslint": "3.0.0",
    "eslint-friendly-formatter": "2.0.7",
    "eslint-loader": "1.6.1",
    "eslint-plugin-import": "2.2.0",
    "eslint-plugin-jsx-a11y": "3.0.2",
    "eslint-plugin-react": "7.5.1",
    "jest": "18.0.0",
    "metro-react-native-babel-preset": "^0.48.1",
    "react-native-schemes-manager": "1.0.1",
    "react-test-renderer": "15.4.1"
  },

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9

github_iconTop GitHub Comments

2reactions
pacocdcommented, Oct 15, 2018

@motogod the issue is not happening in 0.55.4. Just downgrade RN version and replace module:metro-react-native with react-native in your .babelrc.

That worked for me.

1reaction
jaycantycommented, Nov 1, 2018

I was able to get tests running by adding transform to jest in package.json

  "jest": {
    "preset": "react-native",
    "transform": {
      "^.+\\.(js)$": "<rootDir>/node_modules/react-native/jest/preprocessor.js"
    }
  }

Sorry I can explain what is going on here but it worked…

Read more comments on GitHub >

github_iconTop Results From Across the Web

AccessibilityInfo could not be found within the project
please help, i'm facing it since 3 days unable to find solutions. error: bundling failed: Error: Unable to resolve module AccessibilityInfo ...
Read more >
Solved: Unable to resolve module AccessibilityInfo
So, what is the cause of this error and how do we solve it? This error is due to the version of react-native...
Read more >
unable to resolve "firebase" from "app.js" - You.com
I'm a bit lost here, I receive the following error while trying to build an android project (same happens when trying to build...
Read more >
Expo SDK
sdk 33 Error: Unable to resolve module `./node_modules/expo/AppEntry` · Expo SDK · andy4ward June 27, 2019, 4:04pm #1. Upgrading to SDK33 for the...
Read more >
Metro config for out of tree platforms · React Native for ...
The usual way that these show up is a failure something like. Error: Unable to resolve module `./Libraries/Components/AccessibilityInfo/AccessibilityInfo` ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found