Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
palak-parhawk-2003 opened this issue Jul 19, 2024 · 1 comment

Comments

@palak-parhawk-2003
Copy link

palak-parhawk-2003 commented Jul 19, 2024

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
Copy link

"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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants