2008 Elantra stalls within seconds of starting

My daughter’s 2008 Elantra starts fine and seems to be idling okay. But recently at seemingly random times the car will stall within a few yards after she starts driving from a cold start. She will start the car, start to drive and then all of the dash lights come on and the engine shuts off. So far she has been able to turn the key and immediately restart the car and then it is fine after that. The problem always seems to occur after she has driven somewhere, let the car sit for a couple hours and then tries to drive again. We took to our mechanic and they said there are no diagnostic codes and the fuel pressure seems good. They did identify some kind of voltage drop/issue with the mass airflow sensor and replaced it. But a day later the problem occurred again. Mechanic seems stumped. I’m very worried about my teenage daughter driving a car that randomly stalls. Any ideas?

The problem might be with a flaky crankshaft position sensor.

https://www.rockauto.com/en/moreinfo.php?pk=1002319&cc=1441283&jsn=316

Not only does the crankshaft position detect for misfires, but also informs the computer whether or not the engine is rotating.

If the computer loses the signal from this sensor where it thinks the engine isn’t rotating, the computer see’s no reason to operate the ignition/fuel systems and the engine shuts off.

Since this condition is predictable, leave the vehicle at the shop so they can plug a scanner in. Then when it happens to them, they can check for lack of crankshaft position sensor signal.

Because, a defective crankshaft position sensor won’t always cause the Check Engine light to come on.

Tester

I would think the engine is starving of air or fuel. Check the fuel pump relay under the hood and and make sure it’s seated nice and snug. Better yet, unplug it and and make sure the connectors are clean and plug it back in.

Also replace the fuel filter, cheap and easy to replace.

Testing for fuel pressure is one thing, testing for fuel volume is another. I assume fuel pressure was tested while the car was in park and standing still. Pressure can change when the car is being driven and the fuel pump has to spin like crazy under the various stop and go driving conditions. While the hood is up, check your air filter.