1950: "Strange Exodus", a short story by Robert Abernathy, first published in Planet Stories, Fall 1950, available at the Internet Archive. The text of "Strange Exodus" is also available at Project Gutenberg.
Earth has been overrun by a swarm of giant worms from outer space.
Editorial blurb:
Gigantic, mindless, the Monsters had come out of interstellar space to devour Earth. They gnawed at her soil, drank deep of her seas. Where, on this gutted cosmic carcass, could humanity flee?
Excerpt:
He should have foreseen that and made his escape in time. Now that he had solved the problem of human survival.... But the bright ocean laughed at him, sparkling away wave beyond rolling wave, and beyond that blue headland could be only a land made desert, where men become beasts fought crazily over the last morsels of food. He had lost track of the days he had been on the monster's back, but the rape of Earth must be finished now. He had no doubt that the things would depart as they had come into the Solar System—in that close, seemingly one-willed swarm that Earth's astronomers had at first taken for a comet. If this one was leaving, the rest no doubt were too.
Excerpt:
"There are so many of them, and we've destroyed so few—and to kill those few took our mightiest weapons. Examination of the ones that have been killed discloses the reason why ordinary projectiles and bombs and poisons are ineffective against them—apart, that is, from the chief reason of sheer size. The creatures are so loosely organized that a local injury hardly affects the whole. In a sense, each one of them is a single cell—like the slime molds, the Earthly life forms that most resemble them.
"That striking resemblance, together with the fact that they chose Earth to attack out of all the planets of the Solar System, shows they must have originated on a world much like this. But while on Earth the slime molds are the highest reticular organisms, and the dominant life is all multicellular, on the monsters' home world conditions must have favored unicellular growth. Probably as a result of this unspecialized structure, the monsters have attained their great size and perhaps for the same reason they have achieved what even intelligent cellular life so far hasn't—liberation from existence bound to one world's surface, the conquest of space. They accomplished it not by invention but by adaptation, as brainless life once crawled out of the sea to conquer the dry land.
"The monsters who have descended on Earth must represent the end result of a long evolution completed in space itself. They are evidently deep-space beings, able to propel themselves from planet to planet and from star to star in search of food, guided by instinct to suns and worlds like ours. Descending on such a planet, they move across its surface systematically ingesting all edible material—all life not mobile enough to avoid their march. They are like caterpillars that overrun a planet and strip it of its leaves, before moving on to the next.
"Man is a highly mobile species, so our direct casualties of this invasion have been very light and will continue to be. But when the monsters have finished with Earth, there will be no vegetation left for man's food, no houses, no cities, none of the fixed installations of civilization, and the end will be far more terrible than if we were all devoured by the monsters."