getDocuments errors with msg.startsWith is not a function when collection doesn't exist
rinheimerle opened this issue · comments
Rin Heimerle commented
Provide environment information
Environment: locally
NextJS version 13.4.12
What browser are you using? (if relevant)
Firefox 116.02
How are you deploying your application? (if relevant)
Vercel
Describe the Bug
Recently, I used getDocuments
following the basic fetching data example.
The function continually errors with msg.startsWith is not a function
.
After some debugging, I noticed the collection hadn't been populated yet in my outstatic/content
folder.
Expected Behavior
Ideally, outstatic would return a more meaningful error message, perhaps something like "collection doesn't exist".
Link to reproduction - Issues with a link to complete (but minimal) reproduction code will be addressed faster
https://github.com/rinduggan/portfolio
To Reproduce
- Use the
getDocuments
function, following the fetching data example. - For the first parameter, pass in a collection name that doesn't exist in the
outstatic/content
folder.
Andre Vitorio commented
Hey @rinduggan, it seems this is resolved based on our discord chat. Would it be possible for you to comment a solution? Thanks