Error Message
While trying to resolve module `firebase` from file `C:\Users\HP\Desktop\sparta-study\hikingsquirrel\App.js`, the package `C:\Users\HP\Desktop\sparta-study\hikingsquirrel\node_modules\firebase\package.json` was successfully found. However, this package itself specifies a `main` module field that could not be resolved (`C:\Users\HP\Desktop\sparta-study\hikingsquirrel\node_modules\firebase\index`. Indeed, none of these files exist:
Solution
New version of firebase can get the error above.
In this case, you can add '/compat' as follows.
새로운 버전의 firebase에서는 import 할 때 위와 같은 에러가 날 수 있습니다.
이럴때 아래와 같이 '/compat'을 써주면 해결이 됩니다.
import * as firebase from 'firebase/compat';
LIST
'Computer Programming > React-Native' 카테고리의 다른 글
React-Native Error Case(firebase, module 'idb') (0) | 2022.08.26 |
---|---|
React-Native Error Case(ViewPropTypes) (0) | 2022.08.26 |
(React-Native) Project: 로그인 기능(부적절한 input 값 알려주기) (0) | 2022.08.25 |
(React-Native) Project: Animatable(애니메이션 효과 넣기) (0) | 2022.08.23 |
(React-Native) Project: TabNavigator 기능 넣기 (0) | 2022.08.15 |