0
votes

Using firebase sdk I successfully login a user but later I can't query any data from the realtime database. Chrome console says that snapshot.val() is null or it fires an error in firebase-database.min.js. I tried many sort of querys and path format in ref value (from official doc and forums). When I try to console.log the snapshot, it returns a firebase object. Adding .val() returns null. But I have data on db.

I have also tried .once or await async functions but it gives me same result.

I use firebase js sdk from cdn (v8): https://cdnjs.com/libraries/firebase/8.10.0

Links to code and errors screnshots: https://drive.google.com/drive/folders/1H72Df14H374PeSRLdAIXYHD11zfuaEiv?usp=sharing

db.ref('menus').orderByChild('list_order').on('value', (snapshot) => {
            prj.configs.menu = snapshot.val();  
        });