I am not sure how it works scientifically, but usually the first few things a dog herds or has a very reinforcing time staring at, become “fixed” and hard to teach them NOT to enjoy staring at. Kind of the same way a baby duck might learn to follow a person or a dog if that is what he sees first… This is not always the case, but I know many puppies this has happened to.
As you can see in this picture, Halo wants to herd the toy I’m holding above the camera and not the chickens that are moving around. This was actually the first time he saw my chickens out and about as they flew over their barrier and without any training with chickens he prefers to look at the toy rather than the chickens behind him. So the hack is, instead of letting your puppy first see and get herdy with a moving car, motorbikes, a bird, a cat, wildlife, a shadow, planes, running kids, your own dogs moving around…. first create some highly reinforcing experiences with playing with and herding things you have 100% control over like dog toys. Once playing and herding the toys is established, you can then have your puppy look at the things you don’t want him to herd and mark and feed treats after 1 second of looking without thinking of moving toward the thing. Then you can mark and feed for ignoring the distraction.
If shadow chasing or light chasing is in your dogs lines, or you just want to play it safe, the first few times you play with toys where you throw them or you are moving around, play when it’s cloudy or dusk so there is no possibility for your puppy to notice and follow the shadow of you or the toy. Never have your puppy wear a tag on his collar that creates a reflection. And if your puppy notices a light or shadow as soon as you can get your puppies attention, or pick him up and redirect him to something else.