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
- Update User Error
```ts const { users, databases } = await createAdminClient(); const session = await getLoggedInUser(); const user = await users.get(session.$id); if (!use...
- apple exchange code to token
hello guys, im new here 🙂 I have created a project and enabled apple oauth, filled all data (client id, key id, p8 file itself etc). I generate oauth code form...
- How to Avoid Double Requests in function...
I'm currently using Appwrite's `functions.createExecution` in my project. I want to avoid double requests when multiple actions (like searching or pagination) a...