langflow-ai/langflow · warning · Error

errors.tooManyFiles

Error message

errors.tooManyFiles

What it means

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.

Source

Thrown at src/frontend/src/modals/fileManagerModal/components/dragFilesComponent/index.tsx:179

      } catch (error: any) {
        setErrorData({
          title: t("fileManager.errorUploadingFile"),
          list: [error.message || t("fileManager.errorUploadingFileDetail")],
        });
      }
    }
  };

  const handleSelectFolder = async () => {
    try {
      const selected = await createFileUpload({
        accept: types?.map((type) => `.${type}`).join(",") ?? "",
        multiple: true,
        webkitdirectory: true,
      });

      if (selected.length > 1000) {
        throw new Error(t("errors.tooManyFiles", { count: selected.length }));
      }

      const hiddenFiltered = filterHiddenAndIgnoredFolderFiles(selected);
      const typeFiltered = filterFilesByTypes(hiddenFiltered.filtered, types);
      const deduped = dedupeFolderRootIfNeeded({
        files: typeFiltered,
        existingRoots: new Set([
          ...Array.from(existingFolderRoots),
          ...Array.from(sessionUsedFolderRootsRef.current),
        ]),
        renameOnCollision: true,
      });

      const finalRootName = deduped.renamedRootName ?? deduped.rootName;
      if (finalRootName) {
        sessionUsedFolderRootsRef.current.add(finalRootName);
      }

View on GitHub (pinned to 976ec789d2)

Solutions

  1. Select a narrower subfolder that contains only the intended data files
  2. Delete or move aside node_modules/.git from the folder before selecting it
  3. 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
  4. Split into multiple selections of <1000 files

Example fix

// before — raw count checked before filtering
if (selected.length > 1000) throw new Error(t("errors.tooManyFiles", { count: selected.length }));

// after — filter first, then enforce the limit on what would actually upload
const filtered = filterHiddenAndIgnoredFolderFiles(selected).filtered;
if (filtered.length > 1000) throw new Error(t("errors.tooManyFiles", { count: filtered.length }));
Defensive patterns

Strategy: validation

Validate before calling

const MAX_FILES = 1000;
// Count after hidden/ignored filtering when possible; drag-drop path already filters first
if (selected.length > MAX_FILES) {
  notify(t("errors.tooManyFiles", { count: selected.length }));
  return;
}

Try / catch

try { await handleSelectFolder(); }
catch (e) {
  if (e instanceof Error && /too many files/i.test(e.message)) {
    guideUserToNarrowerFolder();
  } else throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of langflow-ai/langflow@976ec789d2 (2026-08-14). Data as JSON: /api/errors/98f5a3db316b2985. Report an issue: GitHub.