I’m attempting to upgrade my Expo project to SDK version 52, but I’m encountering a persistent Babel error that I can’t resolve. Below are the details of my setup, configurations, and the specific errors I’m facing.
Project Configuration
package.json
:
{
"name": "app-mobile",
"version": "1.0.0",
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start --dev-client",
"android": "expo run:android",
"ios": "expo run:ios",
"web": "npx expo start --web"
},
"dependencies": {
"@react-native-async-storage/async-storage": "1.17.11",
"@react-native-picker/picker": "2.4.8",
"@react-navigation/bottom-tabs": "^6.5.7",
"@react-navigation/native": "^6.1.6",
"@react-navigation/native-stack": "^6.9.12",
"axios": "^1.7.2",
"expo": "~52.0.0",
"expo-dev-client": "~2.2.1",
"expo-linear-gradient": "^12.1.2",
"expo-splash-screen": "~0.18.2",
"expo-status-bar": "~1.4.4",
"nativewind": "^2.0.11",
"papaparse": "^5.4.1",
"react": "18.2.0",
"react-native": "0.72.0",
"react-native-dropdown-picker": "^5.4.6",
"react-native-fingerprint-scanner": "^6.0.0",
"react-native-fs": "^2.20.0",
"react-native-gesture-handler": "~2.9.0",
"react-native-heroicons": "^3.2.0",
"react-native-modal": "^13.0.1",
"react-native-ratings": "^8.1.0",
"react-native-reanimated": "~2.14.4",
"react-native-safe-area-context": "4.5.0",
"react-native-screens": "~3.20.0",
"react-native-star-rating": "^1.1.0",
"react-native-svg": "13.4.0",
"react-native-vector-icons": "^9.2.0",
"tailwindcss": "^3.2.7"
},
"devDependencies": {
"@babel/core": "^7.22.17",
"@types/react": "~18.2.14",
"babel-preset-expo": "^9.2.0",
"typescript": "^4.0.0"
},
"private": true
}
babel.config.js
:
module.exports = function(api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
plugins: ['nativewind/babel'],
};
};
tailwind.config.js
:
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
"./App.{js,jsx,ts,tsx}",
"./screens/**/*.{js,jsx,ts,tsx}",
"./components/**/*.{js,jsx,ts,tsx}"
],
theme: {
extend: {},
},
plugins: [],
};
postcss.config.js
:
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
};
index.js
:
import { registerRootComponent } from 'expo';
import App from './App';
registerRootComponent(App);
App.js
:
import { StatusBar } from 'expo-status-bar';
import { SafeAreaView, StyleSheet, Text, View } from 'react-native';
import AppNavigation from './navigation/appNavigation';
import { AuthProvider } from './hooks/AuthProvider';
export default function App() {
return (
<AuthProvider>
<AppNavigation />
<StatusBar style="auto" />
</AuthProvider>
);
}
metro.config.js
:
// Learn more https://docs.expo.io/guides/customizing-metro
const { getDefaultConfig } = require('expo/metro-config');
module.exports = getDefaultConfig(__dirname);
Errors Encountered
-
Babel Error:
ERROR index.js: [BABEL] C:UserssalvaDesktopEstia Codeapp-mobileindex.js: .plugins is not a valid Plugin property
-
iOS Bundling Error:
iOS Bundling failed 455ms C:UserssalvaDesktopEstia Codeapp-mobileindex.js (1 module) ERROR index.js: [BABEL] C:UserssalvaDesktopEstia Codeapp-mobileindex.js: .plugins is not a valid Plugin property
Request for Help
Has anyone encountered the .plugins is not a valid Plugin property
error when upgrading to Expo SDK 52? If so, how did you resolve it? Any guidance on what might be causing this issue or additional steps I should take would be greatly appreciated.
Thank you in advance for your assistance!