Drawer Navigation을 설치하다가
다음과 같은 에러가 발생했습니다.
ERROR Error: Requiring module "node_modules\react-native-reanimated\src\index.ts", which threw an exception: Error: Failed to initialize react-native-reanimated library, make sure you followed installation steps here: https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation/
1) Make sure reanimated's babel plugin is installed in your babel.config.js (you should have 'react-native-reanimated/plugin' listed there - also see the
above link for details)
2) Make sure you reset build cache after updating the config, run: yarn start --reset-cache
ERROR Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 11): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient, RCTEventEmitter.
A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.
ERROR Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 11): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient, RCTEventEmitter.
A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.
✔ 에러 메시지를 잘 보면 정답이 있습니다.
제가 실수로 네비게이션에 필요한 모든 패키지를
Install 하지 않아서 발생한 에러였습니다.
또한 bable.config.js 파일의 수정이 필요합니다.
📝 해결법
https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation/
Installation | React Native Reanimated
Installing Reanimated requires a couple of additional steps compared to installing most of the popular react-native packages.
docs.swmansion.com
✔ 해당 사이트에 해결 방법이 제시되어 있습니다. 😀
⦁ 해결
//1. 터미널에 입력
yarn add react-native-reanimated
//2. babel.config.js 파일 수정
module.exports = function(api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
plugins: [
'react-native-reanimated/plugin',
],
};
};
참고 문헌 : https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation/
'Front-End > React Native' 카테고리의 다른 글
[React Native] 리액트 네이티브 차트 라이브러리 추천 (0) | 2023.01.08 |
---|---|
[React Native] RNSVGSvsViewAndroid 에러, ReadableMap 에러 해결방법 (0) | 2022.12.15 |
[React Native] 리액트 네이티브 Expo Audio 녹음, 재생 구현하기 (0) | 2022.11.24 |
[React Native] 리액트 네이티브 링크 Linking 사용방법 (0) | 2022.11.17 |
[React Native] 리액트 네이티브 라인 차트 만들기 (react-native-chart-kit) (0) | 2022.10.31 |