In your mind the barrier is. Hmm?
Bad Yoda jokes aside, aside from hard core rigid genre-ists (think Tolkein fan fiction) everything is a continuum. You could call Peter Pan a space opera in a way. It's an epic with space travel, but generally it's more of a fantasy. Similarly the Cameron movie Avatar is a clash of a science fiction Earth culture and a fantasy based Pandora culture within the same fictional universe. It brings to mind greek epics where swords and technical ingenuity clashed with magical beings.
And as Clarke is quoted ad nauseum "Any sufficiently advanced technology is indistinguishable from magic." A theme which was ever present in his work. Epic Sci-fi almost always has some kind of mysticism, which others answering here have noted. What some call hard magical fiction, has the same high degree of technicality as hard science fiction. A magical universe can have very complicated laws, both large and small, which govern how one operates upon them, little different to quantum physics, chemistry, etc. And there's plenty of real world occult sources to draw on if you want a whole treatise on what one practitioner thinks is the correct way to look at something, for example.
Once you throw in broadly referential works like Hitch-hikers guide or Adventure Time, or yes I know lots of things that predate those. The genre lines can become almost meaningless.
And speaking of things predating things, there would be no Star Wars without Dune, and there would be no Dune without millennia of cultural knowledge, practices, myth and religion. The division of science and magic is quite a recent idea.