Demo, all content is generated
Question

Bolt burned through 4 million tokens on one TypeScript error, is this normal??

Open · 891 views · asked by valeria_m · edited

Pro plan, had about 5M tokens left on Monday. Now I have 900k. All of it went to this:

src/components/BookingForm.tsx(42,7): error TS2322: Type 'string | undefined' is not assignable to type 'string'.

I clicked Attempt fix, it changed something, new error, Attempt fix again, back to the first error. I think I did this 20+ times. I'm honestly a bit shaky about it, that was money for this month.

What I’ve tried

Attempt fix many times, then wrote "please just fix the typescript error without changing anything else" which also didn't work. Tried reloading the project.

Comment
Same happened to me in july. The fix button is a trap once it starts going in circles. mcflyy · edited
Did you check if you can ask support for tokens back? Someone on discord said they got some beto_codes · edited

4 answers

sergio_ruiz · edited

It's normal in the sense that every Attempt fix sends a big chunk of your project as context, so each loop costs a lot. The error itself is a one-liner, which is the painful part.

string | undefinedstring means line 42 passes a value that might be empty into something that requires text. Two honest fixes:

// if an empty value is fine
name={form.name ?? ""}

// if it should never be empty, stop before rendering
if (!form.name) return null;

Rule I give everyone: if the second Attempt fix doesn't solve it, stop. Open the file, read the exact line from the error, and either fix it by hand or paste only that function + the error into a free chat model. Then come back to Bolt.

Also worth doing: a .bolt/ignore file for big folders (assets, generated data), smaller context per message.

Comment
the ?? "" fixed it. 4 million tokens for 5 characters. Wow. valeria_m · edited
Welcome to the club, most of us have a story like that. sergio_ruiz · edited
mcflyy · edited

Practical thing: enable 'diffs' mode in settings if you don't have it on. Bolt then sends changed parts instead of rewriting whole files, noticeably cheaper when it does go in circles.

Comment
nightowl_nina · edited

Cheap insurance: connect GitHub and let every session start from a clean commit. When Attempt fix goes in circles, you roll back to that commit instead of paying for the way out.

Comment
old_school_raj · edited

Maybe the real lesson is to learn TypeScript instead of paying a chatbot to guess. This is what happens when people who can't code build apps.

Comment
Not helpful mate mcflyy · edited