Daniel Defoe's 1790 novel Robinson Crusoe is considered the first true novel in the modern sense. While other long works had been written and published before, they were usually retellings of myths, legends, and true stories; Robinson Crusoe is entirely fictional.
After being shipwrecked on a deserted island, Robinson Crusoe begins to create the trappings of civilization; he brings tools and wood from the grounded ship, makes fire, builds a fence, and starts to mark time. He notes his accomplishments in a journal, and after an unseasonably cold rainstorm, he catches some flu-like disease (probably compounded by the non-sterile food and water he consumes daily). He recounts a fever-dream:
JUNE 27. - The ague again so violent that I lay a-bed all day, and neither ate nor drank... In this second sleep I had this terrible dream: ...I saw a man descend from a great black cloud, in a bright flame of fire, and light upon the ground. He was all over as bright as a flame... He was no sooner landed upon the earth, but he moved forward towards me, with a long spear or weapon in his hand, to kill me... I heard a voice so terrible that it is impossible to express the terror of it. All that I can say I understood was this: "Seeing all these things have not brought thee to repentance, now thou shalt die;" at which words, I thought he lifted up the spear that was in his hand to kill me.
(Defoe, Robinson Crusoe, eNotes eText)
The dream greatly affects him, and is the start of his conversion to Christianity. Crusoe sees the dream as a metaphor for his luck in landing on an island with all the things necessary for survival, especially fresh water (he was unable to drink the past two days). The being in his dream is God, who is remonstrating him for simply accepting his luck instead of properly attributing it, and punishing him with sickness. He is thereafter grateful to God for providing him with supplies and a fertile island.