#Failed to construct Error in

11 messages · Page 1 of 1 (latest)

deep pagoda
#

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;
}

}

visual flicker
compact saddle
deep pagoda
deep pagoda
visual flicker
#

Can i see the full variable primted?

#

The error is probably malformed endpoint passed into client

deep pagoda
#

i was debugging and according to me the env variables are not correclty accessed in the conf file because the appwrite url in conf is storing the other message rather than storing the endpoint.

#

but i am understanding the reason behind this and not able to decode anything from this

visual flicker
#

@deep pagoda Okay, yeah looks like it's an issue with the URL 🙂