Cursor: “Type 'X' is not assignable to type 'Y'”
What it means
Data shape doesn't match what the code declares, often from an API response or a nullable value.
How to fix it
Find where the value is created, fix the type or handle null instead of casting with 'any'.
Paste this into Cursor
Stop retrying previous fixes. I'm getting this error: "Type 'X' is not assignable to type 'Y'". Likely cause: Data shape doesn't match what the code declares, often from an API response or a nullable value. Before editing, show me the relevant files and confirm the root cause. Then: Find where the value is created, fix the type or handle null instead of casting with 'any'. Change only what's necessary, don't delete working code, don't add new libraries unless required, and tell me exactly what you changed and how to verify it.
Your error's a bit different? Paste it and get a fix prompt written for your exact case.
Get my fix prompt — 3 free