i am facing this error while using the appwrite service to create a blog platform . i have cross checked all the env variables . this is the piece of code where i am setting up the client and account and using them in a try catch and then using it in the app.js i have done all the necessary imports . still unable to understand the error and dont know how to solve it export class AuthService { client = new Client(); account;
constructor() {
this.client
.setEndpoint(conf.appWriteUrl)
.setProject(conf.appWriteProjectId);
this.account = new Account(this.client);
}
async getCurrentUser() { try { return await this.account.get();
} catch (error) {
console.log("Appwrite service :: getCurrentUser :: error", error);
}
return null;
}
}
Can you log the conf.appWriteUrl
real quick?
FYI, it's best to wrap code in backticks to format a bit nicer. You can use 1 backtick for inline code (https://www.markdownguide.org/basic-syntax/#code) and 3 backticks for multiline code (https://www.markdownguide.org/extended-syntax/#syntax-highlighting).
it gives undefined and when i click on the endpoint it also gives this. i am not sure if the endpoint url is supposed to give this or not .
thanks a lot for the insight i ll surely keep in this in mind
this is expected, ur not meant to access the api directly
Can i see the full variable primted?
The error is probably malformed endpoint passed into client
Recommended threads
- Argument of type '"top"' is not assignab...
Hi there! Can someone take a look at my code? I followed the steps from the instruction video, and yet this error appeared out of nowhere. The error is what I m...
- API key doesn't have permission even tho...
Hi All, I seem to be having issues with nodejs and the sdk. I've setup an API key which has all scopes for the project, but I keep getting the "The current us...
- Chat App with Appwrite
Hey guys, I'm adding a chat feature to my app, to some extent alot of things is working work fine, but i have an issue i want to be able to check on the status ...