Web Developer
async getCurrentUser() {
try {
return await this.account.get();
} catch (error) {
console.log("Appwrite serive :: getCurrentUser :: error", error);
}
return null;
}
Votes
0
Replies
16
Participants
Unknown
Messages
17
Web Developer
async getCurrentUser() {
try {
return await this.account.get();
} catch (error) {
console.log("Appwrite serive :: getCurrentUser :: error", error);
}
return null;
}
Are you using the project id when setting up the appwrite client
and is it the correct id for your project
Web Developer
Yes I used correct ID but they show an error
where are you getting the id from
can you show how your appwrite client is being initialized
Web Developer
constructor() {
this.client
.setEndpoint(conf.appwriteUrl)
.setProject(conf.appwriteProjectID);
this.account = new Account(this.client);
}
where are you setting conf.appwriteProjectID?
can you show that and if you have it in your env show your env names
Web Developer
const conf = {
appwriteUrl: String(import.meta.env.VITE_APPWRITE_URL),
appwriteProjectID: String(import.meta.env.VITE_APPWRITE_PROJECT_ID),
appwriteDatabaseID: String(import.meta.env.VITE_APPWRITE_DATABASE_ID),
appwriteCollectionID: String(import.meta.env.VITE_APPWRITE_COLLECTION_ID),
appwriteBucketID: String(import.meta.env.VITE_APPWRITE_BUCKET_ID)
}
export default conf;
I think you've probably mistyped something somewhere and it's not being included.
Web Developer
VITE_APPWRITE_URL="https://nyc.cloud.appwrite.io/v1"
VITE_PROJECT_PROJECT_ID="688f08de002b9111ec5b"
VITE_PROJECT_DATABASE_ID="688f09c4000c886d5ed6"
VITE_PROJECT_COLLECTION_ID="688f15ab0026d9ad1b88"
VITE_PROJECT_BUCKET_ID="688f1a70002aade68d11"
Yea, you don't have your variables right
VITE_PROJECT_PROJECT_ID != VITE_APPWRITE_PROJECT_ID
Web Developer
Ohhh Thank a lot
[SOLVED] Project ID not found
[SOLVED] Project with ID could not be found