I have a 99 TJ 4.0L. It started stalling out and threw a P0340 and P1391 code. I changed out the spark plugs and then installed a new distributor with new camshaft position sensor.
P0340 No Cam Signal At PCM No fuel sync.
P1391 Intermittent Loss of CMP or CKP Loss of the Cam Position Sensor or Crank Position sensor has occurred. For PL 2.0L
I was pretty confident that replacing the distributor would solve the problem, but when I took it out for a test drive the problem started again. After about 10 minutes of driving, the engine started to cut out and stall. It stalled and ran, stalled and ran, stalled and ran for a minute or so and then stalled completely. Took about a minute or so and then i was able to get it running again and got it home. Didn’t try to stall at all for the mile or so back to the house. Didn’t throw a check engine light during this process.
I am out of ideas without going on an easter egg hunt for every sensor in the thing.