[PR #4825] [CLOSED] fix: return documents array from YouTube transcript loader #4781

Closed
opened 2026-02-22 18:36:31 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Mintplex-Labs/anything-llm/pull/4825
Author: @GreyC
Created: 1/5/2026
Status: Closed

Base: masterHead: fix/youtube-transcript-documents-return


📝 Commits (3)

  • fe2fabd fix: return documents array from YouTube transcript loader
  • 1ceeb4d Remove manually constructed document and use returned value from writeToServerDocuments()
  • 7450d6b Merge branch 'master' into fix/youtube-transcript-documents-return

📊 Changes

1 file changed (+4 additions, -2 deletions)

View changed files

📝 collector/utils/extensions/YoutubeTranscript/index.js (+4 -2)

📄 Description

Pull Request Type

  • feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 🔨 chore
  • 📝 docs

Relevant Issues

none

What is in this change?

The loadYouTubeTranscript function was returning a data object instead of a documents array. This caused a crash when using the /v1/document/upload-link API with a YouTube URL and the addToWorkspaces parameter:

TypeError: Cannot read properties of undefined (reading 'location')

This fix changes the return value to include a documents array with the location field, matching the format expected by the API and used by other document processors.

Additional Information

The error occurs at server/endpoints/api/document/index.js:446 where the code accesses documents?.[0].location to pass to uploadToWorkspace().

Developer Validations

  • I ran yarn lint from the root of the repo & committed changes
  • Relevant documentation has been updated
  • I have tested my code functionality
  • Docker build succeeds locally

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Mintplex-Labs/anything-llm/pull/4825 **Author:** [@GreyC](https://github.com/GreyC) **Created:** 1/5/2026 **Status:** ❌ Closed **Base:** `master` ← **Head:** `fix/youtube-transcript-documents-return` --- ### 📝 Commits (3) - [`fe2fabd`](https://github.com/Mintplex-Labs/anything-llm/commit/fe2fabd25638505a7a5cd6a10f070aadaea2fc7e) fix: return documents array from YouTube transcript loader - [`1ceeb4d`](https://github.com/Mintplex-Labs/anything-llm/commit/1ceeb4d7f2ac9d3117b1395777fb9ae1eff4e9a5) Remove manually constructed document and use returned value from writeToServerDocuments() - [`7450d6b`](https://github.com/Mintplex-Labs/anything-llm/commit/7450d6bcbad07f44ae22c298000b2f2d8edc2576) Merge branch 'master' into fix/youtube-transcript-documents-return ### 📊 Changes **1 file changed** (+4 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `collector/utils/extensions/YoutubeTranscript/index.js` (+4 -2) </details> ### 📄 Description ### Pull Request Type - [ ] ✨ feat - [x] 🐛 fix - [ ] ♻️ refactor - [ ] 💄 style - [ ] 🔨 chore - [ ] 📝 docs ### Relevant Issues none ### What is in this change? The [loadYouTubeTranscript](cci:1://file:///home/cg/workspace/anything-llm/collector/utils/extensions/YoutubeTranscript/index.js:91:0-164:1) function was returning a [data](cci:1://file:///home/cg/workspace/anything-llm/collector/utils/extensions/YoutubeTranscript/index.js:166:0-191:1) object instead of a `documents` array. This caused a crash when using the `/v1/document/upload-link` API with a YouTube URL and the `addToWorkspaces` parameter: ```TypeError: Cannot read properties of undefined (reading 'location')``` This fix changes the return value to include a `documents` array with the `location` field, matching the format expected by the API and used by other document processors. ### Additional Information The error occurs at `server/endpoints/api/document/index.js:446` where the code accesses `documents?.[0].location` to pass to `uploadToWorkspace()`. ### Developer Validations - [x] I ran `yarn lint` from the root of the repo & committed changes - [ ] Relevant documentation has been updated - [x] I have tested my code functionality - [ ] Docker build succeeds locally --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-22 18:36:31 -05:00
yindo closed this issue 2026-02-22 18:36:31 -05:00
yindo changed title from [PR #4825] fix: return documents array from YouTube transcript loader to [PR #4825] [CLOSED] fix: return documents array from YouTube transcript loader 2026-06-05 15:20:21 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#4781