Photon Flashing Red

I have a frustrating problem. My code runs fine on a Photon and then all of a sudden, the Photon starts flashing red rapidly. It then resets itself and starts working again.

I noticed myDevices showing panic, assert_failed

What may be causing this?

Can you share your code?