diegosouzapw/OmniRoute · error
Invalid JSON edit body: ${err instanceof Error ? err.message
Error message
Invalid JSON edit body: ${err instanceof Error ? err.message : err} What it means
Error "Invalid JSON edit body: ${err instanceof Error ? err.message : err}" thrown in diegosouzapw/OmniRoute.
Source
Thrown at src/app/api/v1/images/edits/route.ts:181
}).formData();
return await readMultipartImage(formData);
} catch (err) {
log.warn("IMAGE", `Invalid multipart body: ${err instanceof Error ? err.message : err}`);
return null;
}
}
if (contentType.includes("application/json")) {
try {
const parsed = ImageEditJsonSchema.safeParse(
JSON.parse(new TextDecoder().decode(rawBody)) as unknown
);
if (!parsed.success) {
log.warn("IMAGE", `Invalid JSON edit body shape: ${parsed.error.message}`);
return null;
}
return extractImageEditInputFromJson(parsed.data);
} catch (err) {
log.warn("IMAGE", `Invalid JSON edit body: ${err instanceof Error ? err.message : err}`);
return null;
}
}
return null;
}
function jsonResponse(data: unknown, status = 200): Response {
return new Response(JSON.stringify(data), {
status,
headers: { "Content-Type": "application/json" },
});
}
/** Reduce reference images (multi + single fallback) to data-URL strings for Firefly. */
function buildAdobeFireflyEditDataUrls(
images: Array<{ bytes: Buffer; mime: string }>,
imageBytes: Buffer | null,
imageMime: string | nullView on GitHub (pinned to a179ffed5b)
When it happens
Trigger: Thrown at src/app/api/v1/images/edits/route.ts:181 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25).
Data as JSON: /api/errors/9d51e673faccd9c5.
Report an issue: GitHub.