React Expo Error With TypeError: (0 , sourceMapString_1.default) is not a function On Android Build

问题描述 投票:0回答:1

我的 android 构建失败并出现以下错误 `MT

[标准错误]

TypeError:(0,sourceMapString_1.default)不是函数 2024 年 8 月 8 日星期四 20:17:02 GMT

[标准错误]

at /home/expo/workingdir/build/node_modules/@expo/metro-config/build/serializer/withExpoSerializers.js:98:55`

升级和降级expo、metro-config以及android min sdk版本、babel版本。没有任何效果。 具有相同包 json/build 配置的先前分支正在工作,但现在也失败了。所以我迷路了。

{ "name": "tagged-fe", "version": "1.0.0", "main": "node_modules/expo/AppEntry.js", "scripts": { "start": "expo start", "android": "expo run:android", "ios": "expo run:ios", "web": "expo start --web", "preview-android": "eas build -p android --profile preview" }, "dependencies": { "@expo-google-fonts/inter": "^0.2.3", "@expo/config-plugins": "^7.8.0", "@expo/metro-runtime": "~3.1.3", "@expo/prebuild-config": "^6.7.0", "@expo/webpack-config": "^19.0.0", "@react-native-async-storage/async-storage": "^1.21.0", "@react-navigation/material-top-tabs": "^6.6.6", "@react-navigation/native": "^6.1.7", "@react-navigation/native-stack": "^6.9.13", "@shopify/flash-list": "1.6.3", "axios": "^1.5.1", "babel-plugin-module-resolver": "^5.0.2", "expo": "~50.0.19", "expo-av": "~13.10.6", "expo-constants": "~15.4.6", "expo-contacts": "~12.8.2", "expo-dev-client": "~3.3.12", "expo-device": "~5.9.4", "expo-font": "~11.10.3", "expo-haptics": "~12.8.1", "expo-image": "~1.10.6", "expo-linking": "~6.2.2", "expo-notifications": "~0.27.8", "expo-sharing": "~11.10.0", "expo-splash-screen": "~0.26.5", "expo-status-bar": "~1.11.1", "link-preview-js": "^3.0.5", "lottie-react-native": "6.5.1", "metro-config": "^0.80.10", "react": "18.2.0", "react-dom": "18.2.0", "react-native": "0.73.6", "react-native-link-preview": "^1.4.2", "react-native-paper": "^5.10.4", "react-native-reanimated": "^3.14.0", "react-native-safe-area-context": "4.8.2", "react-native-screens": "~3.29.0", "react-native-tab-view": "^3.5.2", "react-native-toast-message": "^2.1.7", "react-native-web": "~0.19.6", "react-native-webview": "13.6.4", "recoil": "^0.7.7" }, "devDependencies": { "@babel/core": "^7.25.2", "@types/react": "~18.2.14", "prettier": "^3.0.3", "typescript": "^5.1.3" }, "private": true } 

react-native expo
1个回答
0
投票

我遇到了同样的问题,升级到 expo 51.0.26 就可以了。希望有帮助!

© www.soinside.com 2019 - 2024. All rights reserved.