[英]Expo start don't works after Upgrading Expo 26 to 32
After upgrading expo
from: SDK 26 to SDK 32, I have the following issue when I use expo run emulator
or expo app
:将
expo
从 SDK 26 升级到 SDK 32 后,当我使用expo run emulator
或expo app
时出现以下问题:
/Users/name user/project name/node_modules/expo/AppEntry.js: Cannot read property '1' of undefined
/Users/name 用户/项目名称/node_modules/expo/AppEntry.js:无法读取未定义的属性“1”
AppEntry.js: AppEntry.js:
import { KeepAwake, registerRootComponent } from 'expo';
import App from '../../App';
if (__DEV__) {
KeepAwake.activate();
}
registerRootComponent(App);
package.json:包.json:
{
“main”: “node_modules/expo/AppEntry.js”,
“private”: true,
“scripts”: {
“test”: “node ./node_modules/jest/bin/jest.js --watchAll”
},
“jest”: {
“preset”: “jest-expo”
},
“dependencies”: {
“@expo/samples”: “2.1.1”,
“babel-preset-expo”: “^5.1.1”,
“expo”: “^32.0.0”,
“npm”: “^4.6.1”,
“react”: “16.5.0”,
“react-native”: “https://github.com/expo/react-
native/archive/sdk- 32.0.0.tar.gz”,
“react-native-animatable”: “^1.2.4”,
“react-native-device-info”: “^0.21.5”,
“react-native-drawer”: “^2.5.0”,
“react-native-drawer-menu”: “^0.2.5”,
“react-native-elements”: “^0.19.1”,
“react-native-fetch-polyfill”: “^1.1.2”,
“react-native-geocoder”: “^0.5.0”,
“react-native-geocoding”: “^0.3.0”,
“react-native-google-maps-directions”: “^2.0.0”,
“react-native-keyboard-spacer”: “^0.4.1”,
“react-native-maps”: “^0.21.0”,
“react-native-masked-text”: “^1.6.5”,
“react-native-qrcode-svg”: “^5.1.1”,
“react-native-select-input-ios”: “^1.2.0”,
“react-native-swipeable”: “^0.6.0”,
“react-native-swiper”: “^1.5.13”,
“react-native-touch-id”: “^4.0.4”,
“react-native-vector-icons”: “^4.6.0”,
“react-navigation”: “^3.0.9”
},
“devDependencies”: {
“@babel/core”: “^7.4.3”,
“@babel/preset-env”: “^7.0.0-beta.47”,
“gulp-babel”: “^7.0.1”,
“jest-expo”: “^32.0.0”
}
}
EDIT: After adjusting at the suggestion, I'm getting this error:编辑:根据建议进行调整后,我收到此错误:
Users/user name/project name/App.js: Cannot read property 'filename' of undefined
用户/用户名/项目名称/App.js:无法读取未定义的属性“文件名”
Any ideas on potential solutions to try?关于尝试的潜在解决方案的任何想法? Any help would be greatly appreciated!
任何帮助将不胜感激!
Looking at the issue log for expo
, I see someone else had a similar issue when updating from:查看
expo
的问题日志,我看到其他人在更新时遇到了类似的问题:
SDK version 30 to SDK version 31 SDK 版本 30 到 SDK 版本 31
and the issue was related to their babel
configuration.这个问题与他们的
babel
配置有关。 Perhaps you're dealing with the same issue, maybe you could try the solution they suggested and see if that resolves your issue as well since you're updating from SDK version 26.也许您正在处理同样的问题,也许您可以尝试他们建议的解决方案,看看是否也能解决您的问题,因为您是从 SDK 版本 26 更新的。
Here is what they suggested:这是他们的建议:
Install the latest version of babel-plugin-module-resolver
:安装最新版本的
babel-plugin-module-resolver
:
npm i --save-dev babel-plugin-module-resolver@latest
alternatively:或者:
yarn add babel-plugin-module-resolver@latest
Additionally, others had to change their .babelrc
contents to use the "babel-preset-expo"
preset:此外,其他人必须更改他们的
.babelrc
内容以使用"babel-preset-expo"
预设:
.babelrc .babelrc
{
"presets": ["babel-preset-expo"]
}
Hopefully that helps!希望这有帮助!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.