Expo SDK44 로 올리며 발생한 문제 해결

햄스터아저씨·2021년 12월 17일
0

1. react-native-reanimated 관련 문제

에러내용

Error: Requiring module "node_modules/react-native-reanimated/src/Animated.js", which threw an exception: Error: Reanimated 2 failed to create a worklet, maybe you forgot to add Reanimated's babel plugin?

해결방법

SDK44로 올라오면서 reanimated가 babel에 포함되어야 하도록 변경되었다.
예를들어 기존 babel 설정이 아래와 같다면

{
  "presets": ["babel-preset-expo"],
  "plugins": [
    [
      "module-resolver",
      {
        "root": ["./"],
        "alias": {
          "@components": "./src/Components",
          "@screens": "./src/Screens",
          "@store": "./src/Store",
          "@src": "./src",
        }
      },
    ],
  ],
}

여기에 react-native-reanimated/plugin 을 추가해야 한다.

{
  "presets": ["babel-preset-expo"],
  "plugins": [
    [
      "module-resolver",
      {
        "root": ["./"],
        "alias": {
          "@components": "./src/Components",
          "@screens": "./src/Screens",
          "@store": "./src/Store",
          "@src": "./src",
        }
      },
    ],
    "react-native-reanimated/plugin", //이 부분
  ],
}

2. react-native-gesture-handler 관련문제

에러내용

Android Bundling failed 10425ms
node_modules/react-native-gesture-handler/src/handlers/gestures/GestureDetector.tsx: helperSkipTransparentExpressionWrappers.skipTransparentExprWrapperNodes is not a function

해결방법

직접적으로 해당 에러가 언급된 글이 없음.
나름대로 여기저기 찾아다니며 분석해 본 결과, 설치된 패키지에 문제가 있을 것으로 추정,
node_modules 삭제 후 yarn install 로 재설치 하고 실행하니 해결 됨.

profile
서버도 하고 웹도 하고 시스템이나 인프라나 네트워크나 그냥 다 함.

0개의 댓글