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
- Authentication on custom Websocket Serve...
Hi, I want to use a custom Websocket Server (using Bun) for my application. However I cant really figure out authentication on custom servers. Session cookies ...
- Realtime for files() works almost well, ...
I have been trying to make use of realtime, today (14.03.26) I have pulled all the latest versions of docker images, and sdk available. Whats working: - Conn...
- Function issue
Hi,idk whats wrong with my function but i made some changes to the env var and made sure they saved then i redeployed it,but then after it redeeployed it asked ...