reactnativecn / react-native-website

React Native 中文网
https://reactnative.cn
MIT License
217 stars 328 forks source link

求助:升级为0.64.2报错 #466

Closed Maty0712 closed 2 years ago

Maty0712 commented 3 years ago

After upgrading to 0.64.2 according to the document, an error is reported in debug mode: The simulator error is as follows: error: TypeError: Cannot use 'in' operator to search for '/Users/matypro_13/Desktop/Simon/apps/simonSmart/simon-smart-app/index.js' in undefined at removeInlineRequiresBlockListFromOptions (/Users/matypro_13/Desktop/Simon/apps/simonSmart/simon-smart-app/node_modules/metro/src/lib/transformHelpers.js:238:19) at Object. (/Users/matypro_13/Desktop/Simon/apps/simonSmart/simon-smart-app/node_modules/metro/src/lib/transformHelpers.js:281:31) at Generator.next () at asyncGeneratorStep (/Users/matypro_13/Desktop/Simon/apps/simonSmart/simon-smart-app/node_modules/metro/src/lib/transformHelpers.js:104:24) at _next (/Users/matypro_13/Desktop/Simon/apps/simonSmart/simon-smart-app/node_modules/metro/src/lib/transformHelpers.js:126:9) at /Users/matypro_13/Desktop/Simon/apps/simonSmart/simon-smart-app/node_modules/metro/src/lib/transformHelpers.js:133:7 at new Promise () at Object. (/Users/matypro_13/Desktop/Simon/apps/simonSmart/simon-smart-app/node_modules/metro/src/lib/transformHelpers.js:122:12) at Object.transform (/Users/matypro_13/Desktop/Simon/apps/simonSmart/simon-smart-app/node_modules/metro/src/lib/transformHelpers.js:291:22) at /Users/matypro_13/Desktop/Simon/apps/simonSmart/simon-smart-app/node_modules/metro/src/DeltaBundler/traverseDependencies.js:326:34

Simulator Screen Shot - iPhone 8 - 2021-07-05 at 20 50 19

截屏2021-07-05 下午8 50 17

The real machine reports the error as follows: The service and the network are under the same network, and the computer can also access the Internet

IMG_0112

截屏2021-07-06 上午9 12 50

Excuse me, why is this, help! ! !

sunnylqm commented 3 years ago

请按文档说明操作升级,不要自己随便挖坑,不是哪个依赖都能随便升到最新版的

Maty0712 commented 3 years ago

请按文档说明操作升级,不要自己挖坑,不是随便随便升到最新版的

按文档升级也是一样的报错呀

sunnylqm commented 3 years ago

贴下package.json

Maty0712 commented 3 years ago

贴下package.json


{
  "main": "index.js",
  "scripts": {
    "start": "react-native start",
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "web": "expo start --web",
    "test": "jest --watchAll",
    "install": "node ./script/react-scrollview-fix.js && cd ./script/MigrateAndroidX && node index.js"
  },
  "jest": {
    "preset": "jest-expo",
    "moduleFileExtensions": [
      "ts",
      "tsx",
      "js"
    ],
    "transform": {
      "^.+\\.(js)$": "<rootDir>/node_modules/babel-jest",
      "\\.(ts|tsx)$": "<rootDir>/node_modules/ts-jest/preprocessor.js"
    },
    "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$",
    "testPathIgnorePatterns": [
      "\\.snap$",
      "<rootDir>/node_modules/"
    ],
    "cacheDirectory": ".jest/cache"
  },
  "dependencies": {
    "@expo/samples": "~3.0.3",
    "@expo/vector-icons": "^10.0.0",
    "@react-native-community/blur": "^3.6.0",
    "@react-native-community/masked-view": "^0.1.10",
    "@react-native-community/netinfo": "5.5.0",
    "coordtransform": "2.1.2",
    "deep-equal": "^1.0.1",
    "deprecated-react-native-listview": "^0.0.6",
    "emoji-flag": "^1.1.0",
    "expo": "^37.0.0",
    "expo-asset": "~8.1.3",
    "expo-av": "^8.1.0",
    "expo-barcode-scanner": "~8.1.0",
    "expo-blur": "~8.1.0",
    "expo-camera": "^8.3.1",
    "expo-constants": "~9.0.0",
    "expo-contacts": "~8.1.0",
    "expo-file-system": "~8.1.0",
    "expo-font": "~8.1.0",
    "expo-image-picker": "~8.1.0",
    "expo-keep-awake": "~8.1.0",
    "expo-linear-gradient": "~8.1.0",
    "expo-localization": "~8.1.0",
    "expo-permissions": "~8.1.0",
    "expo-secure-store": "~8.1.0",
    "expo-web-browser": "~8.1.0",
    "i18n-js": "^3.1.0",
    "jcore-react-native": "^1.7.5",
    "jpush-react-native": "^2.7.5",
    "jshare-react-native": "^1.4.1",
    "lodash": "^4.17.11",
    "lottie-ios": "3.1.8",
    "lottie-react-native": "^4.0.2",
    "md5": "^2.2.1",
    "mobx": "^4.15.4",
    "mobx-persist": "^0.4.1",
    "mobx-react": "^5.4.2",
    "moment": "^2.23.0",
    "native-echarts": "^0.5.0",
    "prop-types": "^15.6.2",
    "react": "17.0.1",
    "react-native": "~0.64.2",
    "react-native-app-settings": "2.0.1",
    "react-native-bundle-splitter": "^1.0.7",
    "react-native-chart-kit": "^2.6.1",
    "react-native-column-slider": "^1.0.1",
    "react-native-device-info": "~0.23.0",
    "react-native-device-log": "^1.0.2",
    "react-native-draggable-flatlist": "^1.1.5",
    "react-native-dropdownalert": "^3.8.0",
    "react-native-exit-app": "^1.1.0",
    "react-native-fetch-polyfill": "^1.1.3",
    "react-native-fit-image": "^1.5.4",
    "react-native-gesture-handler": "~1.10.3",
    "react-native-gizwits--cert-pinner": "^0.4.1",
    "react-native-gizwits-android-wifi": "^0.0.39",
    "react-native-gizwits-bluetooth-status": "^1.3.3",
    "react-native-gizwits-component-menu": "^1.0.5",
    "react-native-gizwits-component-tabs": "^2.1.2",
    "react-native-gizwits-palette-full": "1.0.6",
    "react-native-gizwits-rn-geofence": "3.0.4",
    "react-native-gizwits-sdk": "2.22.8",
    "react-native-gizwits-secharts": "^1.7.1",
    "react-native-gizwits-shortcut": "2.0.3",
    "react-native-google-signin": "^2.1.0",
    "react-native-input-scroll-view": "^1.8.0",
    "react-native-iphone-x-helper": "^1.3.1",
    "react-native-largelist-v3": "^3.0.15",
    "react-native-localize": "^1.3.0",
    "react-native-network-info": "^5.1.0",
    "react-native-parallax-scroll-view": "^0.21.3",
    "react-native-progress": "^4.1.2",
    "react-native-qrcode": "^0.2.7",
    "react-native-qrcode-svg": "^5.2.0",
    "react-native-radial-gradient": "^1.0.6",
    "react-native-reanimated": "~1.7.0",
    "react-native-restart": "0.0.8",
    "react-native-safe-area-context": "^3.0.5",
    "react-native-screens": "~2.2.0",
    "react-native-scrollable-tab-view": "^1.0.0",
    "react-native-send-intent": "1.0.28",
    "react-native-shadow": "^1.2.2",
    "react-native-snap-carousel": "^3.8.4",
    "react-native-splash-screen": "^3.2.0",
    "react-native-spring-scrollview": "^2.0.23",
    "react-native-startapp": "^1.0.3",
    "react-native-statusbar-alert": "^0.4.0",
    "react-native-svg": "11.0.1",
    "react-native-swipe-list-view": "^3.1.0",
    "react-native-swiper": "^1.6.0",
    "react-native-unimodules": "~0.9.0",
    "react-native-video": "^4.4.5",
    "react-native-web": "^0.11.7",
    "react-native-webview": "^9.2.2",
    "react-native-wifi-reborn": "^4.2.0",
    "react-native-zip-archive": "4.1.2",
    "react-navigation": "^4.3.9",
    "react-navigation-drawer": "^2.4.13",
    "react-navigation-stack": "^2.7.0",
    "react-navigation-tabs": "^2.8.13",
    "recyclerlistview": "^3.0.0",
    "rn-fetch-blob": "^0.12.0",
    "rn-snoopy": "^2.0.2",
    "sp-react-native-mqtt": "^0.4.25",
    "tinycolor2": "^1.4.1"
  },
  "devDependencies": {
    "@babel/core": "~7.12.9",
    "@babel/runtime": "^7.12.5",
    "@react-native-community/eslint-config": "^2.0.0",
    "@types/expo-localization": "^1.0.1",
    "@types/i18n-js": "^3.0.1",
    "@types/jest": "^24.9.0",
    "@types/node": "^13.13.2",
    "@types/react": "^16.9.11",
    "@types/react-native": "^0.60.22",
    "@types/react-test-renderer": "^16.9.1",
    "@types/tinycolor2": "^1.4.2",
    "babel-eslint": "^10.0.1",
    "babel-jest": "~26.6.3",
    "babel-plugin-transform-remove-console": "^6.9.4",
    "babel-preset-expo": "^8.1.0",
    "eslint": "^7.14.0",
    "eslint-config-airbnb": "^17.1.1",
    "eslint-plugin-import": "^2.18.0",
    "eslint-plugin-jsx-a11y": "^6.2.3",
    "eslint-plugin-react": "^7.14.2",
    "jest": "~26.6.3",
    "jest-expo": "^37.0.0",
    "metro-react-native-babel-preset": "~0.64.0",
    "react-native-typescript-transformer": "^1.2.12",
    "react-test-renderer": "~17.0.1",
    "ts-jest": "^24.0.2",
    "tslint": "^5.18.0",
    "typescript": "^3.8.3"
  },
  "resolutions": {
    "react-native-svg": "11.0.1",
    "lottie-react-native": "^3.3.2"
  },
  "private": true
}
sunnylqm commented 3 years ago

看下metro.config.js

以及你是从什么版本升上来的,有对照 https://react-native-community.github.io/upgrade-helper/ 做手动修改吗?

Maty0712 commented 3 years ago

https://react-native-community.github.io/upgrade-helper/ metro.config.js : const { resolve } = require('path'); const fs = require('fs');

// Update the following line if the root folder of your app is somewhere else. const ROOT_FOLDER = resolve(__dirname, '.');

const config = { transformer: { getTransformOptions: (_, { platform }) => { let modulePaths = []; const moduleMap = {};

  if (platform === 'android') {
    modulePaths = require('./packager/modules.android');
  } else {
    modulePaths = require('./packager/modules.ios');
  }

  modulePaths.forEach((path) => {
    if (fs.existsSync(path)) {
      moduleMap[resolve(path)] = true;
    }
  });

  return {
    preloadedModules: moduleMap,
    transform: { inlineRequires: { blacklist: moduleMap } },
  };
},

}, projectRoot: ROOT_FOLDER, };

module.exports = config;

从0.63.0升上来的,对着Upgrade Helper修改了 package.json、Podfile和AppDelegate,另外升级了单独升级了react-native-gesture-handler

sunnylqm commented 3 years ago

image

image

为了ZZ正确,他们把blacklist改成了blockList

Maty0712 commented 3 years ago

好的,我去修改一下,感谢😁

Maty0712 commented 3 years ago

image

image

为了ZZ正确,他们把blacklist改成了blockList

大佬,请问下 ,我把blacklist更改为blockList后,在iOS 模拟器上运行成功了,但是在真机上报错: No bundle URL present.

Make sure you're running a packager server or have included a .jsbundle file in your application bundle. ,并且在release下是会闪退的,是为什么呢

sunnylqm commented 3 years ago

模拟器检查有没有开wifi,wifi在不在同一网段,有没有防火墙等等,检查的基本都是网络问题

真机报错得看系统控制台,抓日志

---原始邮件--- 发件人: @.> 发送时间: 2021年7月6日(周二) 下午5:08 收件人: @.>; 抄送: "Sunny @.**@.>; 主题: Re: [reactnativecn/react-native-website] 求助:升级为0.64.2报错 (#466)

为了ZZ正确,他们把blacklist改成了blockList

大佬,请问下 ,我把blacklist更改为blockList后,在iOS 模拟器上运行成功了,但是在真机上报错: No bundle URL present.

Make sure you're running a packager server or have included a .jsbundle file in your application bundle. ,并且在release下是会闪退的,是为什么呢

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

Maty0712 commented 3 years ago

模拟器检查有没有开wifi,wifi在不在同一网段,有没有防火墙等等,检查的基本都是网络问题 真机报错得看系统控制台,抓日志 ---原始邮件--- 发件人: @.> 发送时间: 2021年7月6日(周二) 下午5:08 收件人: @.>; 抄送: "Sunny @.**@.>; 主题: Re: [reactnativecn/react-native-website] 求助:升级为0.64.2报错 (#466) 为了ZZ正确,他们把blacklist改成了blockList 大佬,请问下 ,我把blacklist更改为blockList后,在iOS 模拟器上运行成功了,但是在真机上报错: No bundle URL present. Make sure you're running a packager server or have included a .jsbundle file in your application bundle. ,并且在release下是会闪退的,是为什么呢 — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

debug模式下的模拟器是可以跑起来的,真机是在同一网络下,网络也是可以访问的,但debug下的真机和release模式下的真机、模拟器都不能运行,看控制台也是报 No bundle URL present.

sunnylqm commented 3 years ago

这得具体工程具体调试看问题了,你这只言片语我无法分析。需要的话我可以提供付费咨询,qq34731408

---原始邮件--- 发件人: @.> 发送时间: 2021年7月6日(周二) 下午5:28 收件人: @.>; 抄送: "Sunny @.**@.>; 主题: Re: [reactnativecn/react-native-website] 求助:升级为0.64.2报错 (#466)

模拟器检查有没有开wifi,wifi在不在同一网段,有没有防火墙等等,检查的基本都是网络问题 真机报错得看系统控制台,抓日志 … ---原始邮件--- 发件人: @.> 发送时间: 2021年7月6日(周二) 下午5:08 收件人: @.>; 抄送: "Sunny @.@.>; 主题: Re: [reactnativecn/react-native-website] 求助:升级为0.64.2报错 (#466) 为了ZZ正确,他们把blacklist改成了blockList 大佬,请问下 ,我把blacklist更改为blockList后,在iOS 模拟器上运行成功了,但是在真机上报错: No bundle URL present. Make sure you're running a packager server or have included a .jsbundle file in your application bundle. ,并且在release下是会闪退的,是为什么呢 — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

debug模式下的模拟器是可以跑起来的,真机是在同一网络下,网络也是可以访问的,但debug下的真机和release模式下的真机、模拟器都不能运行,看控制台也是报 No bundle URL present.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

Maty0712 commented 3 years ago

这得具体工程具体调试看问题了,你这只言片语我无法分析。需要的话我可以提供付费咨询,qq34731408 ---原始邮件--- 发件人: @.> 发送时间: 2021年7月6日(周二) 下午5:28 收件人: @.>; 抄送: "Sunny @.**@.>; 主题: Re: [reactnativecn/react-native-website] 求助:升级为0.64.2报错 (#466) 模拟器检查有没有开wifi,wifi在不在同一网段,有没有防火墙等等,检查的基本都是网络问题 真机报错得看系统控制台,抓日志 … ---原始邮件--- 发件人: @.> 发送时间: 2021年7月6日(周二) 下午5:08 收件人: @.>; 抄送: "Sunny @.@.>; 主题: Re: [reactnativecn/react-native-website] 求助:升级为0.64.2报错 (#466) 为了ZZ正确,他们把blacklist改成了blockList 大佬,请问下 ,我把blacklist更改为blockList后,在iOS 模拟器上运行成功了,但是在真机上报错: No bundle URL present. Make sure you're running a packager server or have included a .jsbundle file in your application bundle. ,并且在release下是会闪退的,是为什么呢 — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe. debug模式下的模拟器是可以跑起来的,真机是在同一网络下,网络也是可以访问的,但debug下的真机和release模式下的真机、模拟器都不能运行,看控制台也是报 No bundle URL present. — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

好的

github-actions[bot] commented 2 years ago

👋 Hey there, it looks like there has been no activity on this issue in the last 90 days. Has the issue been fixed, or does it still require the community attention? This issue will be closed in the next 7 days if no further activity occurs. Thank you for your contributions.