image: Experimental_GeneratedImage requires uint8Array, but Image renders from base64 alone
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- frontend
Research direction
Start by locating the ImageProps definition and the Image element that consumes Experimental_GeneratedImage. Confirm that rendering reads only base64 and mediaType, then adjust the public prop type so uint8Array remains accepted but is optional. Verify that callers with only base64 and mediaType typecheck while existing callers with uint8Array remain valid.
Written by the indexing model from the issue text.
Description
Summary
ImageProps extends Experimental_GeneratedImage, which makes uint8Array required:
export type ImageProps = Experimental_GeneratedImage & {
className?: string;
alt?: string;
};
But the element only ever reads base64 and mediaType. Callers that have those two — an image-generation tool result, a stored image record, anything reconstructed from JSON — are forced to fabricate a uint8Array they don't need and the component never touches.
Suggestion
Make it optional while keeping it accepted:
export type ImageProps = Omit<Experimental_GeneratedImage, "uint8Array"> & {
uint8Array?: Experimental_GeneratedImage["uint8Array"];
className?: string;
alt?: string;
};
Backwards compatible — existing callers passing the full object still typecheck.
Context
Raising as an issue rather than a PR since it changes a public prop type and you may prefer a different shape. Happy to send the patch if the direction is right. We currently carry this as a downstream override and would rather not.
- Dominant language
- TypeScript
- Stars
- 2.4k
- Forks
- 283
- Avg merge
- 32m
- Merged PRs (30d)
- 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from vercel/ai-elements
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
vercel/ai-elements#494 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
vercel/ai-elements#490 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
vercel/ai-elements#486 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
vercel/ai-elements#484 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
vercel/ai-elements#441 ·
All issues in vercel/ai-elements
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
fullcalendar/fullcalendar#8106 ·