adrianhajdin / social_media_app

Build a modern social app with a stunning UI with a native mobile feel, a special tech stack, an infinite scroll feature, and amazing performance using React JS, Appwrite, TypeScript, and more.
https://jsmastery.pro
1.18k stars 352 forks source link

TypeError: Cannot read properties of undefined (reading 'replace') #68

Open palak-parhawk-2003 opened 1 month ago

palak-parhawk-2003 commented 1 month ago

appwrite.js?v=521b7f89:707 Uncaught TypeError: Cannot read properties of undefined (reading 'replace') at Client.setEndpoint (appwrite.js?v=521b7f89:707:89) at config.ts:15:8

config.ts file: import { Client, Account, Databases, Storage, Avatars } from "appwrite";

export const appwriteConfig = { url: import.meta.env.VITE_APPWRITE_URL, projectId: import.meta.env.VITE_APPWRITE_PROJECT_ID, 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();

client.setEndpoint(appwriteConfig.url); client.setProject(appwriteConfig.projectId);

export const account = new Account(client); export const databases = new Databases(client); export const storage = new Storage(client); export const avatars = new Avatars(client);

Jstreetman commented 1 month ago

"target": "ES2020", "useDefineForClassFields": true, "lib": [ "ES2020", "DOM", "DOM.Iterable" ], "module": "ESNext", "skipLibCheck": true, / Bundler mode / "moduleResolution": "bundler", "allowImportingTsExtensions": true, "resolveJsonModule": true, "isolatedModules": true, "noEmit": true, "jsx": "preserve", / Linting / "strict": false, "noUnusedLocals": true, "noUnusedParameters": true, "noFallthroughCasesInSwitch": true, "strictNullChecks": false,

paste this in your complieroptions in tsconfig.json, it should fix the issue.