#Unhandled Runtime ErrorAppwriteException: Network request failed
14 messages · Page 1 of 1 (latest)
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