Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled Rejection: snapshot.query.EP is undefined #23

Open
Yeghishe-Karapetyan opened this issue Mar 18, 2021 · 6 comments
Open

Unhandled Rejection: snapshot.query.EP is undefined #23

Yeghishe-Karapetyan opened this issue Mar 18, 2021 · 6 comments

Comments

@Yeghishe-Karapetyan
Copy link

{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject"
},
"dependencies": {
"@react-native-community/masked-view": "0.1.10",
"@react-navigation/bottom-tabs": "^5.11.8",
"@react-navigation/material-bottom-tabs": "^5.3.14",
"@react-navigation/native": "^5.9.3",
"@react-navigation/stack": "^5.14.3",
"expo": "~40.0.0",
"expo-camera": "^10.0.0",
"expo-image-picker": "^10.0.0",
"expo-status-bar": "~1.0.3",
"firebase": "^8.2.9",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-native": "https://github.com/expo/react-native/archive/sdk-40.0.1.tar.gz",
"react-native-gesture-handler": "~1.8.0",
"react-native-paper": "^4.7.2",
"react-native-reanimated": "~1.13.0",
"react-native-safe-area-context": "3.1.9",
"react-native-screens": "~2.15.2",
"react-native-vector-icons": "^8.1.0",
"react-native-web": "~0.13.12",
"react-redux": "^7.2.2",
"redux": "^4.0.5",
"redux-thunk": "^2.3.0"
},
"devDependencies": {
"@babel/core": "~7.9.0"
},
"private": true
}

@Elie-Bsaibes
Copy link

const uid = snapshot..query.C.path.segments[1];
For me the path was different from the one in the tutorial, so try this it might help

@cerovcecblaze
Copy link

A potential solution is to use:

const uid = snapshot.docs[0].ref.path.split('/')[1];

and put that line^ and the rest of the code in that function in a try catch block. The line above will throw an error if there is no documents (posts), so for users where this throws an error, just catch, and do nothing since its pointless to get the posts of a user with no posts.

@minhquan0902
Copy link

minhquan0902 commented May 13, 2021

I think you should console.log(snapshot) for yourself and try to find the segments data based on the console.log, the snapshot data might be different because firebase might update their way to display the snapshot. For my part i was able to retrieve the data from snapshot..query.C.path.segments[1];

@cliadaa
Copy link

cliadaa commented Aug 20, 2021

I'm facing the same issue when fetching userlikes (((snapshot.ZE.path.segments[3];))))), any solutions???

@cliadaa
Copy link

cliadaa commented Aug 20, 2021

A potential solution is to use:

const uid = snapshot.docs[0].ref.path.split('/')[1];

and put that line^ and the rest of the code in that function in a try catch block. The line above will throw an error if there is no documents (posts), so for users where this throws an error, just catch, and do nothing since its pointless to get the posts of a user with no posts.

This worked for me when fetching user posts, any solution for user likes instead of snapshot.ZE.path.segments[3] ???

@MQ-test
Copy link

MQ-test commented May 8, 2022

What does _C_ mean?
(I tried googling before posting).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants