module schedule/tracking does not exist in the Haste module map

后端 未结 3 758
感情败类
感情败类 2020-12-19 01:04

React Native Environment Info:

System:
  OS: macOS High Sierra 10.13.6
  CPU: x64 Intel(R) Core(TM) i3-7100 CPU @ 3.90GHz
  Memory: 559.26 MB / 16.00 GB
  Sh         


        
相关标签:
3条回答
  • 2020-12-19 01:23

    If running with your versions of npm packages:

    react: 16.0.0 => 16.0.0 
    react-native: ^0.57.3 => 0.57.3
    

    We'll have the same error as below:

    error: bundling failed: Error: Unable to resolve module `scheduler/tracing` from 
    `C:\projects\rnw\node_modules\react-native\Libraries\Renderer\oss\ReactNativeRenderer- 
    dev.js`: Module `scheduler/tracing` does not exist in the Haste module map
    

    Upgrade to the following versions:

    "dependencies": {
      "react": "16.6.3",
      "react-native": "0.58.1"
    },
    

    And the error will be gone.

    0 讨论(0)
  • 2020-12-19 01:27

    The error appears due to the renaming of schedule/tracking to schedule/tracing from react@16.5.1 to react@16.5.2.

    The issue is resolved by choosing the correct version of react for your react-native version:

    • RN <= 0.57.2 --> react <= 16.5.1
      • Be sure to lock your react version in this case. Your package.json should look like this: react@16.5.1. Check that there isn't any ^ before the version.
      • (having react@^16.5.1 in your package.json may resolve to a react version >= 16.5.1, which will NOT work)
      • example command: yarn add react@16.5.1
    • RN >= 0.57.3 --> react >= 16.6
      • example command: yarn add react@16.6.0

    For further Information you can check the Github Issue #21150 and Github Issue #21140.

    Sidenote for Expo Users:

    If you are using expo, be aware that expo <= 32.0.0 uses a react-native version <= 0.57.2 and therefore will require the react version to be <= 16.5.1

    If it does not work immediately

    Try to reset the cache of your packager before continuing: yarn start --reset-cache

    0 讨论(0)
  • 2020-12-19 01:37

    If there is an error related to module Schedule/tracking not found, use react-native 0.55.0 version. Above RN->0.55.0 version schedule/tracking package is renamed or moved to another module which is not found by node server.

    Command: react-native init (Project Name) --version 0.55.0

    0 讨论(0)
提交回复
热议问题