
So I am building a project management web app with react and next js and using appwrite as my backend. I am getting an error in uploading comment to this database. I have put all the auth functionalities into a context hook so that I can extract them whenever I want to use them. Here is the auth context function, I use a custom hook for later usage.

I use a state variable to track the session and the current logged in users credentials. Later I extract it in other components so that I can get the user ID. I can get the user ID in the console but for some reason when I extract it in the code and pass it on as a schema to the DB it gives an error that the user ID is missing. Here are the images of the error and user ID in my code.

Now here is some more code. I also use a context hook based approach to pass on the functionalities of a database to child components whenever they need to. Then I extract the funcitionality and then try to pass it to the database like the code img given below.

Now here are some screenshots of the networks tab and the pattern of the collections in the DB.

I know this is a very long question but I have been dealing with this for the last two months, I even changed my tech stack because of this dumb error and it still does not go away
Recommended threads
- CSV Not Importing
We don’t seem to having any luck importing a simple .csv file. The import function acts like it’s working but no data imports or is shown in the collection The...
- There is ui Problem in the Display name
in Display name i have selected buy mistake but when its update that time document get blank and also when i remove at that time also not removing and data is s...
- Database is not working
The database is not working plz check and fix this, tnq
