hi i am geeting this error but the problem is that they coreectly working on localhost
but when switch to deployement and then a also change the url of web app on appwrite but getting this while authentication
here the code
API_ENDPOINT = "https://cloud.appwrite.io/v1" API_PROJECT_ID = "xxxxx" API_DATABASE_ID = "xxxxx" API_COLLECTION_ID = "xxxxx" REDIRECT_GOOGLE_AUTH = "xxxxxxx" FAILURE_ON_GOOGLE_AUTH = "xxxxxxx"
import { Client, Account, Databases, Storage } from 'appwrite';
export const client = new Client();
client
.setEndpoint(${process.env.API_ENDPOINT})
.setProject(${process.env.API_PROJECT_ID});
export const account = new Account(client); export const databases = new Databases(client); export const storage = new Storage(client); export { ID } from 'appwrite';
getCurrentUser : async () => { try { console.log("db ps", process.env.API_DATABASE_ID,) const res = await account.get(); if(res){ console.log(res) set({ userData: { userStatus: res.status, userID: res.$id, userEmail: res.email, userName: res.name, }, }); } } catch (error) { console.log("error on getting current user ",error) } },
this error geeting
TypeError: Failed to construct 'URL': Invalid URL at vY.<anonymous> (index-B2QdyW3V.js:302:24618) at Generator.next (<anonymous>) at index-B2QdyW3V.js:302:17993 at new Promise (<anonymous>) at Mt (index-B2QdyW3V.js:302:17790) at vY.get (index-B2QdyW3V.js:302:24558) at getCurrentUser (index-B2QdyW3V.js:306:645) at index-B2QdyW3V.js:889:14815 at nv (index-B2QdyW3V.js:40:24283) at E0 (index-B2QdyW3V.js:40:42409)
Recommended threads
- Fulltext index creation fails due to Inn...
I'm running a self-hosted Appwrite 1.8.1 instance and encountering an issue when creating fulltext indexes on a collection. **The Problem:** Fulltext index cre...
- Unable To Use Root Domain In Appwrite
Since Appwrite Manages my DNS Completely, I tried Pointing the Root Domain (**getmyself.app**) to Github Pages, It failed So I tried Using Appwrite Sites, also ...
- Report: fetch failed
https://github.com/appwrite/appwrite/issues/10989 please assign this issue to me