I got this error on the console of appwrite cloud when clicking in a document
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'length')
And the document doesnt shows up, some times it goes full black screen or stays at loading and the error on the console shows up
Would you be able to check the network tab and look for the request for the document? Then share the response body
In the network tab there are many things but this is the only one that seems to look like the document that im trying to open
{ "$id": "6502750d3953de32412b", "$createdAt": "2023-09-14T02:50:53.235+00:00", "$updatedAt": "2023-09-14T02:52:08.294+00:00", "$permissions": [ "read(any)", "create(team:64fff91d8c3a37b75906)", "read(team:64fff91d8c3a37b75906)", "update(team:64fff91d8c3a37b75906)" ], "databaseId": "64de657768e3169c1b54", "name": "platformInfo", "enabled": true, "documentSecurity": true, "attributes": [ { "key": "whitelist", "type": "boolean", "status": "available", "required": false, "array": false, "default": null }, { "key": "topbarAlert", "type": "boolean", "status": "available", "required": false, "array": false, "default": null }, { "key": "topbarAlertMessage", "type": "string", "status": "available", "required": false, "array": false, "size": 999, "default": null }, { "key": "maintenance", "type": "boolean", "status": "available", "required": false, "array": false, "default": null }, { "key": "whitelistUsers", "type": "string", "status": "available", "required": false, "array": true, "size": 9999, "default": null } ], "indexes": [] }
and then there is this other one called document and the response is an html
There should be a fetch/xhr request that ends in /documents/[document id]
There is none like /documents/id with the slash, but this one here is called document-65027544323edc9b8fd0
Am I looking for it the right way or im missing something?
It only shows the document id rather than the full path so if you have to click on it to see the full URL.
Anyways, it should be the last or second to last request in that screenshot you shared
ohh i see, the last 2 ends on /documents/id.
here is the response, preview and headers tab:
So the page doesn't load properly when you open this document? Are all the attributes there? Is that null one an array attribute?
Exactly, the page does not load when I open the document, it remains without displaying information. If I refresh everything stays black
The attributes page can be seen, the whitelistUsers does not seem to be in the fetch response could that be the error?
Ya that'd be the problem. That's weird that happened. By default, arrays should be an empty string and never null or missing 🧐
Any idea how this happened?
Hmm weird, I have no idea how it could have happened. Should I try deleting the attribute and doing it again?
You can recreate the document
Alright, how can I delete a document without entering the document view? Is it possible to do it by code? Or how do I access the view of the corrupted document so I can delete it?
You can use a server SDK or Appwrite CLI
alright thank you very much steven i will try that
its fixed now <:appwriterocket:823996226894692403>
[SOLVED] Cannot read properties of undefined on appwrite cloud
Recommended threads
- Our Appwrite organization is suspended
Please give support regarding this , no app is working now , please solve my issue and give support , no one is replying in message section or email.
- Project in AppWrite Cloud doesn't allow ...
I have a collection where the data can't be opened. When I check the functions, there are three instances of a function still running that can't be deleted. The...
- Get team fail in appwrite function
I try to get team of a user inside appwrite function, but i get this error: `AppwriteException: User (role: guests) missing scope (teams.read)` If i try on cl...