急速模块映射中不存在模块时间表

module schedule does not exist in the Haste module map

简介

大家好,我看过类似的关于这个常见问题的问题,但我没能解决。

First question

GitHub post

我尝试了什么?

我尝试按照第一个link,但没有任何反应,尝试在 0.4.0 版本重新安装调度程序。但没有,问题仍然存在。 当我 运行 我在 IOS 模拟器中查看 Xcode 单词“ TEST ” 几秒钟的应用程序时,它崩溃了。

Json 套餐

{
  "scripts": {
    "start": "react-native start",
    "android": "react-native run-android",
    "ios": "react-native run-ios"
  },
  "dependencies": {
    "react": "16.6.3",
    "react-native": "0.58.1"
  },
  "devDependencies": {
    "@babel/core": "^7.3.4",
    "@babel/runtime": "7.0.0",
    "babel-eslint": "^10.0.1",
    "eslint": "^5.15.1",
    "eslint-plugin-react": "^7.12.4",
    "eslint-plugin-react-native": "^3.6.0",
    "metro-react-native-babel-preset": "^0.53.0",
    "schedule": "0.4.0"
  },
  "private": true
}

预期行为

没有这个崩溃。

不确定为什么您的 package.json 中有时间表作为依赖项。这不是必需的,因为它是反应的一部分:https://github.com/facebook/react/tree/master/packages/scheduler

我建议删除它 (yarn remove schedule) 或至少升级到版本 0.5.0 (yarn add --dev schedule@0.5.0) 以与 react 版本兼容。

确保之后重置打包程序的缓存:yarn start --reset-cache