{"record":{"id":"98f5a3db316b2985","repo":"langflow-ai/langflow","slug":"errors-toomanyfiles","errorCode":null,"errorMessage":"errors.tooManyFiles","messagePattern":"errors\\.tooManyFiles","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"src/frontend/src/modals/fileManagerModal/components/dragFilesComponent/index.tsx","lineNumber":179,"sourceCode":"      } catch (error: any) {\n        setErrorData({\n          title: t(\"fileManager.errorUploadingFile\"),\n          list: [error.message || t(\"fileManager.errorUploadingFileDetail\")],\n        });\n      }\n    }\n  };\n\n  const handleSelectFolder = async () => {\n    try {\n      const selected = await createFileUpload({\n        accept: types?.map((type) => `.${type}`).join(\",\") ?? \"\",\n        multiple: true,\n        webkitdirectory: true,\n      });\n\n      if (selected.length > 1000) {\n        throw new Error(t(\"errors.tooManyFiles\", { count: selected.length }));\n      }\n\n      const hiddenFiltered = filterHiddenAndIgnoredFolderFiles(selected);\n      const typeFiltered = filterFilesByTypes(hiddenFiltered.filtered, types);\n      const deduped = dedupeFolderRootIfNeeded({\n        files: typeFiltered,\n        existingRoots: new Set([\n          ...Array.from(existingFolderRoots),\n          ...Array.from(sessionUsedFolderRootsRef.current),\n        ]),\n        renameOnCollision: true,\n      });\n\n      const finalRootName = deduped.renamedRootName ?? deduped.rootName;\n      if (finalRootName) {\n        sessionUsedFolderRootsRef.current.add(finalRootName);\n      }\n","sourceCodeStart":161,"sourceCodeEnd":197,"githubUrl":"https://github.com/langflow-ai/langflow/blob/976ec789d2886a86de109c044d089d68e96c9a35/src/frontend/src/modals/fileManagerModal/components/dragFilesComponent/index.tsx#L161-L197","documentation":"Thrown by handleSelectFolder in the file manager modal when the native folder picker returns more than 1000 files. Unlike the drag path, this runs BEFORE hidden/ignored filtering, so the raw selection count is what trips the limit. The message is the i18n key errors.tooManyFiles with the count interpolated for display.","triggerScenarios":"Using 'Select folder' with webkitdirectory enabled on a directory whose total file count (including .git, node_modules, dotfiles) exceeds 1000 — even if the filtered set would have been small.","commonSituations":"Selecting a project root or home-adjacent folder that contains dependency or VCS directories; the count check firing on folders that drag-drop (which dedupes/filters first) would have accepted.","solutions":["Select a narrower subfolder that contains only the intended data files","Delete or move aside node_modules/.git from the folder before selecting it","If the real dataset is under 1000 after filtering but the raw count is over, drag-drop the folder instead — that path filters before the limit check","Split into multiple selections of <1000 files"],"exampleFix":"// before — raw count checked before filtering\nif (selected.length > 1000) throw new Error(t(\"errors.tooManyFiles\", { count: selected.length }));\n\n// after — filter first, then enforce the limit on what would actually upload\nconst filtered = filterHiddenAndIgnoredFolderFiles(selected).filtered;\nif (filtered.length > 1000) throw new Error(t(\"errors.tooManyFiles\", { count: filtered.length }));","handlingStrategy":"validation","validationCode":"const MAX_FILES = 1000;\n// Count after hidden/ignored filtering when possible; drag-drop path already filters first\nif (selected.length > MAX_FILES) {\n  notify(t(\"errors.tooManyFiles\", { count: selected.length }));\n  return;\n}","typeGuard":null,"tryCatchPattern":"try { await handleSelectFolder(); }\ncatch (e) {\n  if (e instanceof Error && /too many files/i.test(e.message)) {\n    guideUserToNarrowerFolder();\n  } else throw e;\n}","preventionTips":["Select the innermost folder that contains only data files","Remember this path checks the RAW count before filtering — hidden dirs count","If filtered content is small but raw count is large, use drag-drop instead"],"tags":["frontend","file-upload","folder-picker","limit","i18n","file-manager"],"backgroundTag":null,"analyzedSha":"976ec789d2886a86de109c044d089d68e96c9a35","analyzedAt":"2026-08-14T18:23:12.227Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}