Over the past two days, I continually keep getting the error “Failed to Apply Code”. I’ve tried to apply it using different code blocks but I continually get the same error. It doesn’t matter how I phrase it or if it’s on a different code block, there seems to be a blocker that is preventing the successful application of the new code.
Why is this happening? Here’s the error:
45c80300-eebf-4641-bf58-b30499874fe2
Same for me, it started last night. The bigger the changes, the higher the chances it crashes. It seems to be an issue on Cursor.com’s side, as many of us are affected.
I even reinstalled the app, but the problem persists.
Same for me. Just today it started on one file. Yesterday I had the issue where indexing failed with the handshake. This morning, that resolved itself and now this.
Same issue here, 6cb19dc6-242b-40a3-a69b-bbad8fa5ef3a It’s super frustrating to have spent a day developing something only to have the system stop being able to develop it. I’ve tried restarting the app and starting the update in different code blocks and sent an email to the suggested address. Cursor seems great but it’s unusable if it’s suddenly going to stop working in the middle of a project!
Edit: Just to let you know, I am running cursur in Paralles on Win 11 on a Mac. I copied my .py file which was having problems being updated and deleted the contents of the original. Also I was having an underlying issue where Parallels could not access my Mac desltop folder. I shut down the VM, fixed the Paralles permissions issue and restarted everything. The updates then started working again. I dont think this had anything to do with the Parallels permission issue, probably more likely that teh restart or deleting the file contents helped resolve it.
UPDATE: I encountered this issue again this morning and found that it seems to happen when I dont submit any of the project files along with the prompt. I grabbed (in my case) index.js and dropped it into the composer prompt box, then typed in and sent my prompt. This then resolved the issue and it started responding with the code snippets that cursor could apply.
FURTHER UPDATE: I found that sometimes the composer sends a number of files to the LLM and at other times it decides not to. In those cases it starts thinking about the task based only on the file it has been sent. To correct this I dragged all my application files into the composer with the latest instruction and it picked them up in that run and subsequent runs. So it looks to me like the fundamental issue is with the handling of which files are sent to the LLM in the composer message. Hopefully that helps someone at Cursor to resolve this.
I was experiencing the same problem, but after 2 days I realized that the AI had duplicated all my code in the same file, from the tag to the closing tag, so I deleted the code that was repeated and was able to apply the code suggested by the AI.
I am attaching the error message that I was receiving
I have this issue for time to time, let it be chat or composer.
In my case I usually add to the prompt to “return the answer in one code block that I can easily merge as diff”.
In case it continues failing, I copy the code to merge to the clipboard, select the code that I want to merge to, control + k , ask to merge the diff -paste code to merge into control+k ui- , and it usually does the job.