React Native:未捕获(承诺)错误:DeltaPatcher 在初始化时应该收到一个基本bundle



我最近在 http://localhost:8081/debugger-ui/中遇到了这条错误消息,上面写着:

Uncaught (in promise) Error: DeltaPatcher should receive a base Bundle when being initialized
at DeltaPatcher.applyDelta 
at deltaUrlToBlobUrl
at async getBlobUrl 
at async WebSocket.ws.onmessage 
applyDelta  
deltaUrlToBlobUrl       
async function (async)      
ws.onmessage

当我尝试从模拟器打开我的 React Native 应用程序时,会发生此错误,尽管index.ios.js文件成功构建,但应用程序仍卡在启动屏幕上并出现上述错误。

我不知道它指的是什么,也不知道从哪里开始调试这个,或者这个DeltaPatcher来自哪个包。

就我在收到此错误之前所做的事情而言,这就是我正在做的事情:

  • 反应本机选项卡视图的包修复

  • 必须删除 npm-shrinkwrap.json 才能运行 npm 安装

  • 必须卸载并重新安装反应本机启动画面才能通过 使用 Xcode 构建失败

  • 必须在具有项目:写入权限的哨兵中创建新的auth.token。 通过 403 错误

  • 手动从项目中完全删除Instabug

  • 修复了旋转套件和alerts.filter错误

    在此之后,应用程序可以正常工作,但是后来我不得不 解决 Xcode 中的以下错误。

  • 删除了与
    错误相关的8CBD27422B744FC9C0407AA3PhaseScriptExecution

    引用
  • 将配置重构为以前的版本以消除
    AppReactNative崩溃的错误

  • 修改了容器文件配置以反映应用中心升级

  • 删除 instabug 引用和 spinkit 引用

然后我回忆起我安装了 Metro 版本 29 以试图解决另一个问题。所以我完全删除了 Metro 作为一个包,但这还没有解决它。

我正在运行的脚本是react-native run-ios,这是我package.json文件:

"scripts": {
"start": "nps",
"test": "nps setup && nps test",
"build": "nps build",
"prepare": "nps patcher",
"setup": "nps setup && nps appcenter",
"react-devtools": "react-devtools"
},
"dependencies": {
"appcenter": "2.0.0",
"appcenter-analytics": "2.0.0",
"appcenter-crashes": "2.0.0",
"axios": "0.16.2",
"date-fns": "^1.29.0",
"lodash": "4.17.4",
"moment": "2.20.1",
"payment": "2.3.0",
"prop-types": "15.6.0",
"react": "16.8.3",
"react-native": "0.59.9",
"react-native-autoheight-webview": "0.6.1",
"react-native-calendar-events": "1.6.1",
"react-native-device-info": "0.21.5",
"react-native-exception-handler": "2.8.9",
"react-native-image-progress": "1.0.1",
"react-native-immediate-phone-call": "1.0.0",
"react-native-keyboard-aware-scroll-view": "0.4.4",
"react-native-keyboard-manager": "4.0.13-12",
"react-native-material-buttons": "0.5.0",
"react-native-material-dropdown": "0.5.2",
"react-native-material-tabs": "3.5.0",
"react-native-material-textfield": "0.10.0",
"react-native-onesignal": "3.0.7",
"react-native-popup-menu": "0.8.3",
"react-native-sentry": "0.32.0",
"react-native-size-matters": "0.1.0",
"react-native-splash-screen": "3.0.6",
"react-native-svg": "6.3.1",
"react-native-swipe-view": "https://github.com/jjd314/react-native-swipe-view",
"react-native-tab-view": "1.3.2",
"react-native-vector-icons": "6.1.0",
"react-native-xcode-packager": "0.1.0",
"react-navigation": "1.5.11",
"react-redux": "5.0.6",
"reactotron-react-native": "3.5.0",
"reactotron-redux": "3.1.0",
"recompose": "0.26.0",
"redux": "4.0.1",
"redux-thunk": "2.2.0",
"replace-in-file": "3.1.1"
},
"devDependencies": {
"@babel/core": "7.4.5",
"@babel/plugin-proposal-optional-chaining": "7.2.0",
"@babel/runtime": "7.4.5",
"async": "2.6.0",
"babel-cli": "6.24.1",
"babel-eslint": "8.0.2",
"babel-jest": "23.0.0",
"babel-plugin-module-resolver": "3.0.0",
"babel-preset-env": "1.4.0",
"babel-preset-flow": "6.23.0",
"babel-preset-stage-2": "6.24.1",
"babel-watch": "2.0.6",
"chalk": "1.1.3",
"detox": "8.2.3",
"eslint": "4.12.0",
"eslint-import-resolver-babel-module": "4.0.0-beta.3",
"eslint-plugin-import": "2.8.0",
"eslint-plugin-prettier": "2.3.1",
"eslint-plugin-react": "7.5.1",
"flow-bin": "0.46.0",
"fs-extra": "5.0.0",
"jest": "23.0.0",
"metro-react-native-babel-preset": "0.54.1",
"nps": "5.7.1",
"nps-utils": "^1.5.0",
"patch-package": "5.1.1",
"postinstall-prepare": "1.0.1",
"prettier": "1.8.2",
"prettier-eslint": "8.2.2",
"react-devtools": "3.6.1",
"react-test-renderer": "16.2.0",
"redux-mock-store": "1.3.0",
"yargs": "8.0.1"
},
"jest": {
"preset": "react-native",
"setupTestFrameworkScriptFile": "./jest-setup.js",
"transformIgnorePatterns": [
"/node_modules/(?!parse)/"
],
"unmockedModulePathPatterns": [
"react",
"react-navigation",
"axios",
"redux",
"redux-thunk",
"lodash",
"date-fns"
],
"verbose": true
},
"detox": {
"configurations": {
"ios.sim.debug": {
"binaryPath": "ios/build/Build/Products/Debug-iphonesimulator/NFIBEngage.app",
"build": "xcodebuild -workspace ios/NFIBEngage.xcworkspace -configuration Debug -scheme NFIBEngage -sdk iphonesimulator -derivedDataPath ios/build",
"type": "ios.simulator",
"name": "iPhone 6"
}
},
"test-runner": "jest"
}
}

好的,在我删除 Metro 版本 29 之后,我只是继续重复运行这些命令:

rm -rf node_modules && npm install && npm run setup && react-native run-ios

现在,它启动经过启动画面,并显示另一个但更熟悉的错误。

最新更新