getting this error while everything seems fine please help me solve it
this is how my config file looks:
export const appwriteConfig = { projectId :import.meta.env.VITE_APPWRITE_PROJECT_ID, url :import.meta.env.VITE_APPWRITE_URL, databaseId :import.meta.env.VITE_APPWRITE_DATABASE_ID, storageId :import.meta.env.VITE_APPWRITE_STORAGE_ID, userCollectionId :import.meta.env.VITE_APPWRITE_USER_COLLECTION_ID, postCollectionId :import.meta.env.VITE_APPWRITE_POST_COLLECTION_ID, savesCollectionId :import.meta.env.VITE_APPWRITE_SAVES_COLLECTION_ID, };
export const client = new Client() .setProject('appwriteConfig.projectId') .setEndpoint('appwriteConfig.url');
export const account = new Account(client); export const databases = new Databases(client); export const storage = new Storage(client); export const avatars = new Avatars(client);
and this is my .env file looks
VITE_APPWRITE_PROJECT_ID = 6799f41bxxx5b7d20d5b
VITE_APPWRITE_URL = https://cloud.appwrite.io/v1
VITE_APPWRITE_STORAGE_ID = 679a574e0xxxxxx060a
VITE_APPWRITE_DATABASE_ID = 679a5xxxxxx0637725e
VITE_APPWRITE_POST_COLLECTION_ID = 679a57dxxxxxxx5a1c26a
VITE_APPWRITE_USER_COLLECTION_ID = 679a582xxxxd5c4049a7
VITE_APPWRITE_SAVES_COLLECTION_ID = 6xxx584300xxx8fa7424
Can you give the code for signInAccount in the file api.ts
Oh nevermind. The issue is you have your stuff wrapped in quotes. It should be.
export const client = new Client()
.setProject(appwriteConfig.projectId)
.setEndpoint(appwriteConfig.url);
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).
Recommended threads
- is `account.get()` safe to be used in th...
I want to user's `id` for authentication. However, a while ago I was told in this server not to use `account.get()` and instead add user preferences for that us...
- Usage of the new Client() and dealing wi...
Hey guys, just a quick one - we had some web traffic the other day and it ended up bombing out - To put in perspective of how the app works, we have a Nuxt Ap...
- CORS errors in Obsidian custom plugin
Hi, anyone here familiar with obsidian community plugins? In short: it's a local first note app which supports writing your own add-ons / plugin But I keep get...