paperclipai/paperclip · error · Error

Upload did not return a file URL

Error message

Upload did not return a file URL

What it means

Post-condition guard in TaskChatComposer's uploadInlineImage: after requesting an upload via onAttachImage (or onImageUpload), the returned attachment's contentPath/URL is undefined, so the composer cannot build the inline `![](src)` markdown and aborts the (already-inserted 'uploading') attachment instead of embedding a broken image reference. It fires when the upload handler resolves without a file URL — a misconfigured or failed upload callback — not a network error itself.

Solutions

  1. Retry the upload; if it persists, check the asset upload endpoint response for why no file URL was returned.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at ui/src/components/task-chat/TaskChatComposer.tsx:211 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of paperclipai/paperclip@3f1d897a7c (2026-09-18). Data as JSON: /api/errors/882336a8be0d4958. Report an issue: GitHub.

Appendix: source

Thrown at ui/src/components/task-chat/TaskChatComposer.tsx:683

  /** Upload an image and return its URL for inline `![](src)` markdown. */
  async function uploadInlineImage(file: File): Promise<string> {
    const id = crypto.randomUUID();
    setAttachments((prev) => [
      ...prev,
      {
        id,
        name: file.name,
        size: file.size,
        inline: true,
        status: "uploading",
      },
    ]);
    try {
      const attachment = onAttachImage ? await onAttachImage(file) : undefined;
      const url = onAttachImage
        ? attachment?.contentPath
        : await onImageUpload?.(file);
      if (!url) throw new Error("Upload did not return a file URL");
      if (!attachmentsRef.current.some((item) => item.id === id))
        throw new Error("Attachment was removed");
      setAttachments((prev) =>
        prev.map((item) =>
          item.id === id
            ? {
                ...item,
                attachmentId: attachment?.id,
                contentPath: url,
                status: "attached",
              }
            : item,
        ),
      );
      return url;
    } catch (err) {
      setAttachments((prev) =>
        prev.map((item) =>

View on GitHub (pinned to 3f1d897a7c)