Russia has made it clear that Ukrainian membership in the EU would be a red line (that's what drove the Maidan), as are a number of domestic policies it is pursuing. There was no recent movement for Ukrainian membership in NATO, which means it is a poor explanation for this war.
Even if NATO had declared Ukraine would never join, that would not have stopped this war. This was also driven by Ukraine's political orientation and Russia losing influence. Putin even said that Ukraine would present a threat even if it didn't join NATO. 2/
Again, you can track comments from Putin and senior Russian officials over the past two years to see how the rhetoric shifted, largely in response to policies Zelensky pursued. Putin devoted an entire security council meeting to Ukraine in May after Viktor Medvedchuk's arrest. 3/
Thread on Russian losses in Ukraine. Note, I will only share information from Russian sources, either media, social media or officials, which means the family members will have been previously notified.