Demo, all content is generated
Question

Cursor fixed one TypeScript error and now I have 30 new ones

Solved · 5381 views · asked by jakeypoo · edited

I had one red error in a form component. Asked Cursor to fix it. It changed some stuff and now there are 30 errors across 12 files. Asked it to fix those, it fixed some, new ones showed up, now 47. I've been going in circles for 2 hours and I'm scared to touch it. Help lol

What I’ve tried

Let it keep fixing (made it worse), accepted/rejected different fixes, closed and reopened the project.

Comment
Do you have git? If yes, git diff --stat and tell us which files changed. ingrid_h · edited
no git :( jakeypoo · edited

3 answers

Marked as helpful by the asker
katja_s · edited

Stop the loop first. Every "fix the errors" round is working from a worse starting point.

  1. Undo back to the one-error state (Restore Checkpoint on your first message, or git if you have it).
  2. Check what changed besides the component. My bet: it touched tsconfig.json. A very common "fix" is flipping "strict": true or changing moduleResolution, which instantly surfaces dozens of existing errors in other files.
    git diff tsconfig.json
  3. With the original single error, get the full picture yourself:
    npx tsc --noEmit
    and paste only that error, with the file, into a fresh chat: "fix this error in this file only, don't change tsconfig or other files".

The pattern to watch for: error count going up after a fix = the fix changed something global. Revert, don't pile on.

Comment
Because it's the most common one :) Strict is good by the way, turn it on someday on purpose, file by file. katja_s · edited
IT CHANGED STRICT TO TRUE. how did you know. reverted, back to 1 error, fixed that one in 5 minutes jakeypoo · edited
also started using git today because of this whole thing jakeypoo · edited
Error count going up = revert. Writing that on a sticky note. hugo_l · edited
kofi_mensah · edited

Adding a general habit: after any AI change, run npx tsc --noEmit yourself before asking for the next fix. You'll see immediately whether the count went down. The editor's red squiggles only show open files, which is why it felt like errors "appeared" everywhere.

Comment
made an alias tc for it jakeypoo · edited
felix_codes · edited

When reviewing agent diffs, always open the changes to config files first: tsconfig.json, package.json, next.config, eslint config. A one-line change there does more damage than 200 lines in a component.

Comment