Cursor seems far too eager to match an error to a previously known error, and then tries to work around that condition, without checking that it’s actually trying to solve the correct problem.
I was working on creating some Behat (browser) tests for the web frontend.
Cursor couldn’t see the file upload form that I wanted to test, and it started doing a whole lot of “workaround” code. That code was written on an assumption that the reason that it couldn’t see the upload form was that the frontend was being re-rendered by React constantly, and so that the reference to the file input div kept being recreated.
That was not the cae.
The code that was confusing Cursor looks something like this:
if (user.is_logged_in()) {
render_file_upload_form();
}
i.e. if the user is not logged in, the file upload form is never going to be visible.
Does anyone have any suggestion on telling Cursor to only write workaround code when it has some evidence of that being the problem?
It did something very similar the next day, when I encountered another issue (in the testing framework, files need to be referenced using the complete path, not relative path) and again Cursor spent a whole lot of time trying to fix a different problem, rather than saying “it’s not working, I’m not sure why”.