Failed to Apply Code

Hey Cursor team,

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

4 Likes

Same shit. Always Connection failed at some point in chat/composer

Req ID: 74382af7-3782-4255-9881-b623beb91299

same here: 6942f34d-1b65-4bbe-a623-e198500ec021

Me too

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.

also having this issue at the least ideal time.

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.

just started today. I am also experiencing this on a 1000 line long piece of code. very dissappointed

1 Like

same. all of the files where I get this error are over 1000 lines. otherwise, it works as normal.

it seems like it would be obvious to have a longer output length mini model to do the corrections

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.

Is there any solution for this? Its frustrating.

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.

1 Like

same.
I noticed while editing an HTML file, everything was working fine,

then I got the message when I added a complex SVG
Hunch is it’s recognizing that there are many tokens that will be consumed and then refuses.

It’s not an issue with inline SVG bc I had another much simpler shape where it was fine

Hello everyone!

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

image

Same for me. And when I then retry, it applies immediately. I see what the LLM generated, but the application takes so damn long, why???

Same here. Can’t apply code. If I click Apply, I’ll sometimes get a random, empty green line. Nothing works.

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.

1 Like

Thanks for sharing this, it could work as a temporary fix.