fix: 'items.map is not a function' in 'search' tool #7

Closed
numbr3la wants to merge 1 commits from main into main
numbr3la commented 2026-04-19 06:51:39 -06:00 (Migrated from github.com)

Error: docmost__search failed with items.map is not a function because the code assumed response.data.data is always an array. In some Docmost deployments, search results are returned as response.data.data.items.

Fix: Normalize the search response before mapping: accept both formats (data as array or data.items as array), and fall back to an empty array if neither is present.

Error: docmost__search failed with items.map is not a function because the code assumed response.data.data is always an array. In some Docmost deployments, search results are returned as response.data.data.items. Fix: Normalize the search response before mapping: accept both formats (data as array or data.items as array), and fall back to an empty array if neither is present.

Pull request closed

Please reopen this pull request to perform a merge.
Sign in to join this conversation.