![](https://cdn.discordapp.com/avatars/763079282540544040/a9f30a3d2a332e2cb493c55e18cbe7a2.webp)
when running in locahost:3000 got this error. Tech: Nextjs Hostname: localhost
![](https://cdn.discordapp.com/avatars/462046107556511744/504fd808296728e8e89d82b8ea1e77a9.webp)
What's your code? Can you try and give some more context?
![](https://cdn.discordapp.com/avatars/763079282540544040/a9f30a3d2a332e2cb493c55e18cbe7a2.webp)
//appwrite.js file
![](https://cdn.discordapp.com/avatars/763079282540544040/a9f30a3d2a332e2cb493c55e18cbe7a2.webp)
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};
![](https://cdn.discordapp.com/avatars/763079282540544040/a9f30a3d2a332e2cb493c55e18cbe7a2.webp)
![](https://cdn.discordapp.com/avatars/462046107556511744/504fd808296728e8e89d82b8ea1e77a9.webp)
Btw, it's best to use 3 back ticks with multi-line code. See https://www.markdownguide.org/extended-syntax/#syntax-highlighting
![](https://cdn.discordapp.com/avatars/462046107556511744/504fd808296728e8e89d82b8ea1e77a9.webp)
Can you try logging that environment variable before passing it into set project?
![](https://cdn.discordapp.com/avatars/763079282540544040/a9f30a3d2a332e2cb493c55e18cbe7a2.webp)
I couldn't get the solution, so moved to different one! I will close this issues thanks
![](https://cdn.discordapp.com/avatars/204189857105313794/96ca8528e8346f1547d57d05dcf102de.webp)
process.env.NEXT_PUBLIC_APPWRITE_PROJECT_ID!
The exclamation mark might be the issue
![](https://cdn.discordapp.com/avatars/204189857105313794/96ca8528e8346f1547d57d05dcf102de.webp)
it should work with the !
, but it has always given me problems (idk why)
that's why I just do as string
![](https://cdn.discordapp.com/avatars/763079282540544040/a9f30a3d2a332e2cb493c55e18cbe7a2.webp)
It is necessary to use, in order to let the project know that yes, I know this will work
![](https://cdn.discordapp.com/avatars/204189857105313794/96ca8528e8346f1547d57d05dcf102de.webp)
Yes that's true. Regardless, you said you fixed it. Mind sharing how you did that
![](https://cdn.discordapp.com/avatars/204189857105313794/96ca8528e8346f1547d57d05dcf102de.webp)
So other people who face a similar issue can use your solution!
![](https://cdn.discordapp.com/avatars/763079282540544040/a9f30a3d2a332e2cb493c55e18cbe7a2.webp)
Actually could solve it, and had to complete the project, so used mongoDB instead
![](https://cdn.discordapp.com/avatars/763079282540544040/a9f30a3d2a332e2cb493c55e18cbe7a2.webp)
couldn't*
Recommended threads
- Changing Sender Name on Verification Ema...
I want to know if i purchase pro plan shall i be able to change sender name on the email and also the sender email address from appwrite without buying any cu...
- saving objects
hi i want to know if we can save objects as documents attributes in the database and if we can restrict some attributes from getting updated
- GET https://cloud.appwrite.io/v1/account...
create project, create sdk , set the hostname to localhost , give the database as well as storage permission to th user still giving the error
![](/images/bgs/pre-footer.png)