when running in locahost:3000 got this error. Tech: Nextjs Hostname: localhost
What's your code? Can you try and give some more context?
//appwrite.js file
import {Client, Account, ID, Databases, Storage} from "appwrite"; const client = new Client() .setEndpoint("https://cloud.appwrite.io/v1") .setProject(process.env.NEXT_PUBLIC_APPWRITE_PROJECT_ID!)
const account = new Account(client); const databases = new Databases(client); const storage = new Storage(client);
export {client, account, databases, storage, ID};
Btw, it's best to use 3 back ticks with multi-line code. See https://www.markdownguide.org/extended-syntax/#syntax-highlighting
Can you try logging that environment variable before passing it into set project?
I couldn't get the solution, so moved to different one! I will close this issues thanks
process.env.NEXT_PUBLIC_APPWRITE_PROJECT_ID! The exclamation mark might be the issue
it should work with the !, but it has always given me problems (idk why)
that's why I just do as string
It is necessary to use, in order to let the project know that yes, I know this will work
Yes that's true. Regardless, you said you fixed it. Mind sharing how you did that
So other people who face a similar issue can use your solution!
Actually could solve it, and had to complete the project, so used mongoDB instead
couldn't*
Recommended threads
- Endless certificate generation cycle
Hello, when I try to add the subdomain stats.hedgehog-rp.ru, I get an infinite loop while the certificate is being generated. There are no problems with adding ...
- Realtime not working for some tables
Hi, I've got an issue where I can setup a realtime connection to listen to some tables, but some not all. I have two tables `history` and `users`. Both can be ...
- How to handle ghost accounts created by ...
Appwrite create the account with the email and send an invitation link with a secret. I am able to accept the invitation and add the account as a member on the ...