diegosouzapw/OmniRoute · error · Error

t("suiteImportInvalid")

Error message

t("suiteImportInvalid")

What it means

Import-shape validation in handleImportSuite: the selected file parsed as JSON but failed the structural checks (not an object, missing/invalid suites array / version marker of an exported eval-suite file). Pure client-side guard — the localized 'suiteImportInvalid' fires before any upload; no suites were created.

Solutions

  1. Re-export the suite file from a compatible OmniRoute instance
  2. Verify the JSON matches the ImportedEvalSuiteFile shape (suites array present)
  3. Pick the correct file — a single-suite export may need the bulk format
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/app/(dashboard)/dashboard/usage/components/EvalsTab.tsx:628 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/52641907fd93b29a. Report an issue: GitHub.

Appendix: source

Thrown at src/app/(dashboard)/dashboard/usage/components/EvalsTab.tsx:628

      anchor.click();
      URL.revokeObjectURL(url);
      notify.success(t("suiteExported"), t("notifyEvalTitle", { name: suite.name || suite.id }));
    } catch (error: unknown) {
      notify.error(
        t("notifyEvalRunFailedWithReason", {
          reason: getErrorMessage(error) || t("suiteExportFailed"),
        }),
        t("suiteExportFailed")
      );
    }
  }

  async function handleImportSuite(file: File) {
    try {
      const text = await file.text();
      const payload = JSON.parse(text) as ImportedEvalSuiteFile;
      if (!payload || typeof payload !== "object" || !Array.isArray(payload.cases)) {
        throw new Error(t("suiteImportInvalid"));
      }

      const fallbackName =
        file.name
          .replace(/\.eval-suite\.json$/i, "")
          .replace(/\.json$/i, "")
          .replace(/[-_]+/g, " ")
          .trim() || t("suiteBuilderImportedSuite");

      const draft = createDraftFromImportedSuite(payload, fallbackName);
      setSuiteDraft({
        ...draft,
        name: `${draft.name} ${t("suiteBuilderCloneSuffix")}`.trim(),
      });
      setIsBuilderOpen(true);
      notify.success(t("suiteImportReady"), t("notifyEvalTitle", { name: draft.name }));
    } catch (error: unknown) {
      notify.error(

View on GitHub (pinned to a179ffed5b)