If it stalls and restarts right away, check more into fuel pump problems and airflow monitoring systems, possibly even injector pulse (cam sensor related).
If it simply dies without hesitating, I'd guess your crank sensor.
It is behind the crank shaft pulley in front of the motor!
From my experience, If your crank sensors bad the car will not start up at all.
its on the front off the engine you must remove timing belt to replace it
Location is behind the starter,droping the starter makes the job easy.unplug the sensor then pry it out,best with pliers o ring then reinstall.
I would say a badcam or crank sensor. if not scan system for codes
The sensors can be checked with an oscilliscope, graphing multimeter or for frequency(not anywhere near as good). Resistance values are meaningless with the type of sensor used.
where is the crank position sensor located on a 2004 hyundai v-6 2.7 engine
I am working on the same problem in a 1999 Elantra Wagon, and have read that it could be the crank sensor. Hope this helps. here are a couple of possiblities: bad crank sensor, broken or jumped timing belt, bad fuel pump, bad cam sensor. Answer was this the only problem or was the transmission not shifting before too?
At autozone, they are $34.99.
in front of the motor by the transmission
cam or crank sensor