커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
4-7강에서 자꾸 오류가 나네요...
[왕초보] 나만의 수익성 앱, 앱개발 종합반 v5
4주차
북마크
박*
댓글
16
추천
0
조회수
90
조회수
90
답변 완료

* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.

* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.



4-7강 코드스니펫 두개를 그대로 복사했더니 자꾸 오류가 납니다...이유가 뭔지 대체 모르겠습니다.


작성한 코드 및 에러 메세지

firebaseConfig.js 코드입니다.

import firebase from "firebase/compat/app";

// 사용할 파이어베이스 서비스 주석을 해제합니다
//import "firebase/compat/auth";
import "firebase/compat/database";
//import "firebase/compat/firestore";
//import "firebase/compat/functions";
import "firebase/compat/storage";


// Initialize Firebase
//파이어베이스 사이트에서 봤던 연결정보를 여기에 가져옵니다.
const firebaseConfig = {
    apiKey: "AIzaSyDkESdkVREzkx0hsqBl4dnls7r22P0VM5U",
    authDomain: "sparta-myhoneytip-hsy-9acc5.firebaseapp.com",
    databaseURL: "https://sparta-myhoneytip-hsy-9acc5-default-rtdb.asia-southeast1.firebasedatabase.app/tip",
    projectId: "sparta-myhoneytip-hsy-9acc5",
    storageBucket: "sparta-myhoneytip-hsy-9acc5.appspot.com",
    messagingSenderId: "11000965791",
    appId: "1:11000965791:web:0b902c590a8838a0f750aa",
    measurementId: "G-64GG06DT95"
};


//사용 방법입니다. 
//파이어베이스 연결에 혹시 오류가 있을 경우를 대비한 코드로 알아두면 됩니다.
if (!firebase.apps.length) {
    firebase.initializeApp(firebaseConfig);
}


export const firebase_db = firebase.database()

오류 코드입니다.

Error: FIREBASE FATAL ERROR: Database URL must point to the root of a Firebase Database (not including a child path).
at node_modules\react-native\Libraries\Core\ExceptionsManager.js:null in reportException
at node_modules\react-native\Libraries\Core\ExceptionsManager.js:null in handleException
at node_modules\react-native\Libraries\Core\setUpErrorHandling.js:null in handleError
at node_modules\expo\build\errors\ExpoErrorManager.js:null in errorHandler
at node_modules\expo\build\errors\ExpoErrorManager.js:null in <anonymous>
at node_modules\@react-native\polyfills\error-guard.js:null in ErrorUtils.reportFatalError
at node_modules\metro-runtime\src\polyfills\require.js:null in guardedLoadModule
at http://172.30.1.2:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false&strict=false&minify=false:null in global code


[2023-02-14T09:55:33.066Z]  @firebase/database:, FIREBASE FATAL ERROR: Database URL must point to the root of a Firebase Database (not including a child path).
at node_modules\@firebase\logger\dist\index.cjs.js:null in defaultLogHandler
at node_modules\@firebase\logger\dist\index.cjs.js:null in Logger.prototype.error
at node_modules\@firebase\database\dist\index.esm2017.js:null in fatal  
at node_modules\@firebase\database\dist\index.esm2017.js:null in repoManagerDatabaseFromApp
at node_modules\@firebase\database\dist\index.esm2017.js:null in Component$argument_1
at node_modules\@firebase\component\dist\esm\index.esm2017.js:null in Provider#getOrInitializeService       
at node_modules\@firebase\component\dist\esm\index.esm2017.js:null in Provider#getImmediate
at node_modules\@firebase\database-compat\dist\index.esm2017.js:null in 
Component$argument_1
at node_modules\@firebase\component\dist\esm\index.esm2017.js:null in Provider#getOrInitializeService       
at node_modules\@firebase\component\dist\esm\index.esm2017.js:null in Provider#getImmediate
at node_modules\@firebase\app-compat\dist\esm\index.esm2017.js:null in FirebaseAppImpl#_getService
at node_modules\@firebase\app-compat\dist\esm\index.esm2017.js:null in firebaseAppImpl.prototype.componentNameWithoutCompat
at node_modules\@firebase\app-compat\dist\esm\index.esm2017.js:null in serviceNamespace
at firebaseConfig.js:null in <global>
at node_modules\metro-runtime\src\polyfills\require.js:null in loadModuleImplementation
at pages\DetailPage.js:null in <global>
at node_modules\metro-runtime\src\polyfills\require.js:null in loadModuleImplementation
at navigation\StackNavigator.js:null in <global>
at node_modules\metro-runtime\src\polyfills\require.js:null in loadModuleImplementation
at App.js:null in <global>
at node_modules\metro-runtime\src\polyfills\require.js:null in loadModuleImplementation
at node_modules\expo\AppEntry.js:null in <global>
at node_modules\metro-runtime\src\polyfills\require.js:null in loadModuleImplementation
at node_modules\metro-runtime\src\polyfills\require.js:null in guardedLoadModule
at http://172.30.1.2:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false&strict=false&minify=false:null in global code


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.     
at node_modules\react-native\Libraries\Core\ExceptionsManager.js:null in reportException
at node_modules\react-native\Libraries\Core\ExceptionsManager.js:null in handleException
at node_modules\react-native\Libraries\Core\setUpErrorHandling.js:null in handleError
at node_modules\expo\build\errors\ExpoErrorManager.js:null in errorHandler
at node_modules\expo\build\errors\ExpoErrorManager.js:null in <anonymous>
at node_modules\@react-native\polyfills\error-guard.js:null in ErrorUtils.reportFatalError
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:null in __guard
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:null in callFunctionReturnFlushedQueue 


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.     
at node_modules\react-native\Libraries\Core\ExceptionsManager.js:null in reportException
at node_modules\react-native\Libraries\Core\ExceptionsManager.js:null in handleException
at node_modules\react-native\Libraries\Core\setUpErrorHandling.js:null in handleError
at node_modules\expo\build\errors\ExpoErrorManager.js:null in errorHandler
at node_modules\expo\build\errors\ExpoErrorManager.js:null in <anonymous>
at node_modules\@react-native\polyfills\error-guard.js:null in ErrorUtils.reportFatalError
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:null in __guard
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:null in callFunctionReturnFlushedQueue



취소
 공유
취소
댓글 0
댓글 알림
나의얼굴