I know someone asked this, but that was marked as solved without giving what I think is the actual solution. Just in case anyone else hits this, I thought I’d offer my own solution since I’m going through the course and it just happened to me.
I believe the reason that this happens is that weaponCollider.gameObject.SetActive is originally set to true. It is only switched to false after slashing for the first time. So if you slash, it should behave normally after that, but before you slash the collider is active and enemies are reacting to hitting it.
To handle this, I added the following line to the Awake() function in Sword.cs:
weaponCollider.gameObject.SetActive(false);
This makes it so that the weaponCollider is turned off when you start. The second you attack it turns back on to hit and then the code in your animations should turn it back off when the attack is done, making everything function as it should.
Hope this helps.