react-native: bundling failed: Error: Unable to resolve module `schedule/tracking`

Environment

React Native Environment Info:
    System:
      OS: macOS High Sierra 10.13.6
      CPU: x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
      Memory: 52.01 MB / 8.00 GB
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 8.11.2 - ~/.nvm/versions/node/v8.11.2/bin/node
      npm: 6.4.1 - ~/.nvm/versions/node/v8.11.2/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 11.4, macOS 10.13, tvOS 11.4, watchOS 4.3
    IDEs:
      Android Studio: 3.1 AI-173.4907809
      Xcode: 9.4.1/9F2000 - /usr/bin/xcodebuild
    npmPackages:
      @types/react: 16.4.6 => 16.4.6 
      @types/react-native: 0.55.27 => 0.55.27 
      react: 16.4.1 => 16.4.1 
      react-native: ^0.57.0 => 0.57.0 
    npmGlobalPackages:
      create-react-native-app: 1.0.0
      react-native-cli: 2.0.1
      react-native-fbsdk: 0.7.0
      react-native: 0.56.0

Description

After I upgraded react-native from v0.57.0-rc.3 to ^0.57.0 I am getting this error on both ios and android:

error: bundling failed: Error: Unable to resolve module `schedule/tracking` from `/Users/sagarguhe/NodeDevelopment/balletWorkout/node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-dev.js`: Module `schedule/tracking` 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/sagarguhe/NodeDevelopment/balletWorkout/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:209:1301)
    at ResolutionRequest.resolveDependency (/Users/sagarguhe/NodeDevelopment/balletWorkout/node_modules/metro/src/node-haste/DependencyGraph/ResolutionRequest.js:83:16)
    at DependencyGraph.resolveDependency (/Users/sagarguhe/NodeDevelopment/balletWorkout/node_modules/metro/src/node-haste/DependencyGraph.js:238:485)
    at Object.resolve (/Users/sagarguhe/NodeDevelopment/balletWorkout/node_modules/metro/src/lib/transformHelpers.js:180:25)
    at dependencies.map.result (/Users/sagarguhe/NodeDevelopment/balletWorkout/node_modules/metro/src/DeltaBundler/traverseDependencies.js:311:29)
    at Array.map (<anonymous>)
    at resolveDependencies (/Users/sagarguhe/NodeDevelopment/balletWorkout/node_modules/metro/src/DeltaBundler/traverseDependencies.js:307:16)
    at /Users/sagarguhe/NodeDevelopment/balletWorkout/node_modules/metro/src/DeltaBundler/traverseDependencies.js:164:33
    at Generator.next (<anonymous>)
    at step (/Users/sagarguhe/NodeDevelopment/balletWorkout/node_modules/metro/src/DeltaBundler/traverseDependencies.js:266:307)

I deleted node_modules/.cache dir, cleared watchman watches, reset-cache but none worked.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 4
  • Comments: 16

Most upvoted comments

The number of issues with react native have suddenly increased a lot

Fix it with npm i schedule@0.4.0 --save-dev

It looks like you are using an older version of React Native. Please update to the latest release, v0.57 and verify if the issue still exists.

The “⏪Old Version” label will be removed automatically once you edit your original post with the results of running react-native info on a project using the latest release.

The issue got resolved for me when I upgraded and locked my React version also My versions in my package.json

    "react": "16.6.3",
    "react-native": "0.57.8",

So many problems with react native

I miss programming in Swift.

Follow this changelog who are facing the same issue. I needed to upgrade package.json and changed react to the latest i.e. v16.5.1 and removed node_modules and npm install.

@Kevinpahlevi I created a new post with this issue: https://github.com/facebook/react-native/issues/24573 . The short version is that after spending several days trying to upgrade, in the end, I created a new 0.59 project and copied the source code and resources over to it. It was a fairly small project, so wasn’t too hard to do.

@knspatel I had this issue while ejecting from expo as expo had a different version of react-native(a custom .gz file from expo) and react versions. When I fixed the versions of both react and react native it fixed the “schedule/tracking” issue for me.

@akhiljain100 checkout this. It helped me fixing the issue you are running into.

The solution in here helped me fixing our issue.