【问题标题】:TypeError: undefined is not a function, js engine: hermesTypeError: undefined is not a function, js引擎: hermes
【发布时间】:2022-11-29 20:08:01
【问题描述】:

我的 React Native (0.66.3) 应用程序今天弹出一个稳定的代码错误,该代码已经有一段时间没有任何更改了。它在 macOS Big Sur 上。这是错误:

 ERROR  TypeError: undefined is not a function, js engine: hermes
Error: ENOENT: no such file or directory, open '/Users/macair/Documents/code/js/xyz_app5/http:/localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.xyz-app5'
    at Object.openSync (fs.js:498:3)
    at Object.readFileSync (fs.js:394:35)
    at getCodeFrame (/Users/macair/Documents/code/js/xyz_app5/node_modules/metro/src/Server.js:919:18)
    at Server._symbolicate (/Users/macair/Documents/code/js/xyz_app5/node_modules/metro/src/Server.js:992:22)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async Server._processRequest (/Users/macair/Documents/code/js/xyz_app5/node_modules/metro/src/Server.js:403:7) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: '/Users/macair/Documents/code/js/xyz_app5/http:/localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.xyz-app5'
}

这是 IOS 模拟器上显示的错误:

该错误似乎与 React Native 中的地铁有关。

【问题讨论】:

  • 看起来你正在使用键盘感知滚动视图,如果是这样,你能告诉你使用的是哪个版本。也尝试升级它并检查。
  • Akshay Shenoy,键盘感知滚动视图附带哪个模块?它不在 package.json 中
  • 它是“1.0.1”。在@codler 下找到它
  • 升级到 2.0.0,错误消失。非常感谢。
  • 没有任何变化,重新加载应用程序后再次出现完全相同的错误。重新安装并没有解决问题。很奇怪。

标签: react-native metro-bundler react-native-hermes


【解决方案1】:

重新安装 node_modules

 rm -rf node_modules 

清理缓存

 yarn cache clean (or npm cache clean –force)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-06-24
    • 2011-08-13
    • 1970-01-01
    • 2021-06-21
    • 1970-01-01
    • 2014-08-15
    • 2015-01-14
    • 2014-07-06
    相关资源
    最近更新 更多