The first thing that goes wrong is the motor will break the dropouts of the fork. This can also happen with steel forks, if the nut gets loose or the washers don't fit.
The washer never fits a suspension fork, so the first thing you need is called c washers. These go inside the little cup on the fork end, so the larger washers don't crack the fork on the first tighten. Then you need TWO good torque arms.
The second thing that goes wrong is the fork often binds. So you only have shocks when the motor is off. the rest of the time the motor pulls the fork hard enough to jam it, and it behaves like a rigid fork, unless you hit a huge bump. So you learn to get off the throttle crossing the rail road tracks, or dropping off a curb.
You can do it, but its not ideal. In some cases, the motor body itself simply wont fit between the tubes, so you have to find the right fork to begin with.
I'm not blowing this out my ass, I rode to work for 5 years, over 10,000 miles, with front motor and shock fork.
But for the last five years,, I don't run any front hub bikes. :wink: Rear just works better, if you have a choice. Particularly in dirt, where front hub simply sucks. (The exception to this rule is a 2 motor bike)
If you need to run front hub for whatever reason, like you have a rear IGH, then you might choose a bike with rigid steel fork, rather than try to make a full suspension MTB work like I did. If you need a better ride, get a long tail bike. When I went long, I stopped needing suspension as much. The frame rocks, acting like suspension, if your ass is not hanging over the rear wheel.