TL;DR: Expo Web에서 발생하는 500 에러는
react-native-reanimated/plugin과 Expo SDK 53 간의 호환성 문제였습니다. Babel 플러그인을 제거하여 해결했습니다.
React Native 모노레포(Turborepo)에서 Expo 앱을 개발 중이었습니다. 앱은 모바일에서는 정상 작동했지만, Expo Web에서 500 에러가 계속 발생했습니다.
[Reanimated] Seems like you are using a Babel plugin `react-native-reanimated/plugin`.
It was moved to `react-native-worklets` package. Please use `react-native-worklets/plugin` instead.
ERROR index.ts: [BABEL] .plugins is not a valid Plugin property
...bundle?platform=web&...transform.routerRoot=app... returns 500 and JSON MIME type
처음에는 다음과 같은 일반적인 문제들을 의심했습니다:
백업된 코드와 현재 코드를 비교 분석한 결과:
| 설정 파일 | 문제 상태 | 정상 상태 |
|---|---|---|
babel.config.js | plugins: ['nativewind/babel', 'react-native-reanimated/plugin'] | plugins: [] |
package.json | 복잡한 의존성 (nativewind, reanimated, tailwind) | 간단한 기본 의존성 |
metro.config.js | 모노레포 설정 있음 | 없음 |
app.json | "bundler": "webpack" | 기본 웹 설정 |
에러의 진짜 원인은 react-native-reanimated/plugin이었습니다!
react-native-worklets 가이드는 잘못된 정보였음react-native-reanimated/plugin 사용해야 함[Reanimated] Seems like you are using a Babel plugin `react-native-reanimated/plugin`.
It was moved to `react-native-worklets` package.
이 메시지는 오해의 소지가 있었습니다. 실제로는:
react-native-worklets/plugin 사용// babel.config.js
module.exports = function (api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
plugins: [], // Reanimated 플러그인 제거
};
};
# Reanimated v4+로 업그레이드
npx expo install react-native-reanimated@^4.0.0
# babel.config.js 수정
plugins: [
'nativewind/babel',
'react-native-worklets/plugin', // v4+용
]
# Reanimated v3와 호환되는 Expo SDK로 다운그레이드
npx expo install expo@~52.0.0
{
"dependencies": {
"expo": "~53.0.20",
"react-native-reanimated": "~4.0.0" // 최신 버전 사용
}
}
// 필요한 플러그인만 사용
plugins: [
'nativewind/babel', // NativeWind 사용 시에만
// Reanimated는 필요할 때만 추가
];
# 정기적으로 의존성 업데이트
npx expo install --fix
npm update
500 에러가 발생할 때 다음을 확인하세요:
npx expo start -c)이번 트러블슈팅을 통해 Babel 플러그인 호환성이 Expo Web 에러의 주요 원인임을 확인했습니다.
핵심 교훈:
이 경험이 비슷한 문제를 겪는 개발자들에게 도움이 되길 바랍니다! 🎉
바이브코딩으로 초기 세팅할 때의 꿀팁! 초기 세팅에서 계속 에러가 난다면, 해당 라이브러리의 공식 문서를 첨부하면서 공식문서 검토 후 다시 작업 진행하도록 시키면 훨씬 정확도가 높아진다!