LLM returns integers as strings, causing type error in JS

Created on 9 July 2025, 5 days ago

Overview

If you type the following prompt, ai will atempt to create a new image component, but fails due to the 'width' and 'height' prop_metadata values being strings rather than numbers.

Build me an image component of a cat

Proposed resolution

I added:
Ensure when a prop type is not a string, the value type is also preserved.

And this works, but not as we expect -- instead of removing quotes from numbers, it replaced number types with string as the type. This does work.

I haven't tested it yet, but I presume a similar issue exists for other types like boolean.

πŸ› Bug report
Status

Active

Version

0.0

Component

AI

Created by

πŸ‡ΊπŸ‡ΈUnited States japerry KVUO

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024