Babel.js 类型错误:_this7._config.server.rewriteRequestUrl不是函数React Native0.64.1

oknrviil  于 2022-12-08  发布在  Babel
关注(0)|答案(1)|浏览(168)

我已经按照所有的指示在这个upgrade helper升级RNv0.62到v0.64.1和我的应用程序是得到安装成功的设备,但我的地铁捆绑失败与一些随机错误,我无法弄清楚在所有。
每当我试图运行我的打包程序时,它都会抛出这个错误TypeError: _this7._config.server.rewriteRequestUrl is not a function at node_modules/metro/src/Server.js:1011:39,如果有人能帮助我,我应该做些什么来调试这个错误。
为了理解我在控制台中为我的项目和一个正在工作的0.64.1项目记录_this7._config.server对象所做的区别,显然它们是不同的。
我的_this7._config.server在更新过程之后

{
  useGlobalHotkey: true,
  port: 8081,
  enableVisualizer: false,
  enhanceMiddleware: [Function (anonymous)],
  runInspectorProxy: true,
  verifyConnections: false
}

其他_this7._config.server,用于0.64.1,正在运行

{
  useGlobalHotkey: true,
  port: 8081,
  enhanceMiddleware: [Function (anonymous)],
  rewriteRequestUrl: [Function: rewriteRequestUrl],
  runInspectorProxy: true,
  verifyConnections: false
}

我不知道到底哪里出了问题,因为两者不同

pdsfdshx

pdsfdshx1#

我建议你也把你的地铁版本升级一下。
我面临着一个类似的问题,这个问题是与地铁版本冲突。
我们的metro版本是0.56,当从0.63迁移到0.64时,@react-native-community/cli metro版本被迁移到0.64.0。
因为这个地铁决议失败,抛出这个错误

相关问题