I was intrigued by @Radhil's comment to Is Stargate based on the German science fiction series Star Gate?
... but the idea is older than dirt...
Visiting another world is very likely the single earliest theme of any science-fiction story ever written. But considering the context behind the comment (whether or not the original Stargate movie was based on the German novels) it got me wondering, what is the first story (published serial, novel, TV/Movie, or radio program) involving an energy/magic gate/portal MacGuffin that moves people to the location of the story?
I desperately wanted to exclude Star Trek and its ilk based on the idea that the transporter was "short range" and entirely mobile, meaning it was the ship that moved the characters to the story location, not really the transporter. But the Stargate universe muddied the water by introducing mobile stargates in SG-1 and making SG-U fundamentally based on the idea of mobile stargates. So, we're talking some form of gateway or portal through which someone must pass to get to the story location, no matter where they start from. Therefore, stories where a space ship moves them to the story location don't count because there's no gate/portal involved. So, for the purpose of this question, the MacGuffin must be the principal transportation device. Other ways may exist and may be used (shuttles, space ships, etc.), but they're either clearly not the primary travel mechanism or they're intrinsic to the story.
Shows that don't use portals/gates are verboten. Thus, shows like The Starlost and Clarke's Rendezvous with Rama that use a mechanism other than an energy/magic portal/gate to move from location-to-location don't count. I'm looking for stories like The Merchant and the Alchemist, The Time Tunnel and Stargate. (Travel in time or location is acceptable, but Doctor Who isn't because a gate/portal isn't involved. A space ship by any other name....)
The selected answer will be the story with the oldest publication date.
If I need to narrow this, please let me know. I am looking for one, specific story after all.
Clarifications from Comments
The MacGuffin is not required to be fixed to a planet, but it is required to be the primary mode of transportation for the story. This could disqualify Star Trek as the transporter wasn't as important as the ship to the stories. (Per my post above, I really want to exclude Star Trek and its ilk literally because it isn't the transporter that is getting people from Earth to another world. Sounds like we finally found a way to justify the exclusion.)
I'm requiring a MacGuffin. Thus, Edgar Rice Burrough's Barsoom books are disqualified because there isn't a MacGuffin (in fact, there isn't really teleportation, either, as the body is left behind on Earth).
Gates... Portals... Teleporters... please don't become caught up with synonyms. Until they factually exist such that we can distinctly draw unique definitional lines between them, they're all just synonyms for the same kind of literary MacGuffin.
I am looking for intentional fiction. People may consider (e.g.) the Bible to be fiction today, but it wasn't considered fiction when it was written. Indeed, all (or nearly all) religious texts were believed to be factual when written. Thus, the ancient Egyptian Pyramid Texts (circa 2200 BCE) are disqualified as they were believed factual at the time they were written.
Argument against closure
I'm asking for any literary MacGuffin used as the primary method to justify setting a story in another off-Earth location.
The referenced question (here) is narrowly asking about technological teleportation no matter how it relates to the story and excludes all other MacGuffins.
While the answer to the referenced question may be the answer to this one, it needn't and might not be, which makes this question and that one not duplicates.