...a random Star Trek episode

The Next Generation
Season 4, 
Episode 17
Night Terrors
The Enterprise is trapped in a rift, the crew succumbs to REM sleep deprivation, and Deanna has a recurring nightmare.