J.R.R. Tolkien wrote his three main books in the order their contents happen in his fantasy world. But they weren’t published in that order. Young Tolkien writes the various component works of The Silmarillion, middle-aged Tolkien writes and publishes The Hobbit, old Tolkien writes and publishes The Lord of the Rings, then his son Christopher and Guy Gavriel Kay posthumously edit and publish The Silmarillion.
This means that the original readers of The Hobbit and LotR had no idea what Tolkien meant when he alluded to his unpublished mythology in those books. In fact, Tolkien doesn’t seem to have viewed The Hobbit as a serious addition to his world when writing it. He just embellished it with little bits of First and Second Age lore without worrying about whether the parts fit together. But as many critics have remarked, it’s the combination of the everyday folksiness of the hobbits with the high-fantasy elvish tragedy of the mythology that then makes LotR such a great book.
One of my favourite continuity errors in The Hobbit has to do with magic swords. In chapter 2, Gandalf tricks three trolls into staying outdoors until sunrise, whereupon they turn to stone. Afterwards the party loots the cave where the trolls once lived, finding various plunder including two jewel-studded swords. In chapter 3 Elrond takes a look at them and reads their inscriptions.
‘These are not troll-make. They are old swords, very old swords of the High Elves of the West, my kin. They were made in Gondolin for the Goblin-wars. They must have come from a dragon’s hoard or goblin plunder, for dragons and goblins destroyed that city many ages ago. This, Thorin, the runes name Orcrist, the Goblin-cleaver in the ancient tongue of Gondolin; it was a famous blade. This, Gandalf, was Glamdring, Foe-hammer that the king of Gondolin once wore. Keep them well!’
A reader with access to the appendices of LotR and The Silmarillion may find it a little odd that Elrond mentions the fall of Gondolin but not the fact that the entire land mass where the city was located has sunk beneath the sea. But anyway: plunder from Gondolin was apparently taken east to the area where the troll cave is located and has probably been buried there until the trolls somehow got their hands on it. There is no indication that the two swords have been heard of since the First Age. Gandalf doesn’t recognise them, and Elrond has to read their inscriptions to place them correctly.
Now, in chapter 4 comes the continuity error. The dwarves camp one night in the entrance to a major underground goblin/orc lair on a mountain pass and get captured. When the orcs examine their captives’ belongings and find the sword Orcrist, we get this.
The Great Goblin gave a truly awful howl of rage when he looked at it, and all his soldiers gnashed their teeth, clashed their shields, and stamped. They knew the sword at once. It had killed hundreds of goblins in its time, when the fair elves of Gondolin hunted them in the hills or did battle before their walls. They had called it Orcrist, Goblin-cleaver, but the goblins simply called it Biter. They hated it and hated worse any one that carried it.
The orcs, brutish short-lived illiterates though they are, apparently have a pretty amazing body of oral tradition concerning old weapons. Because the sword Orcrist hasn’t been heard of since the fall of Gondolin, which at the time of Bilbo Baggins’s momentuous adventure with the dwarves and the wizard lies about 6,500 years in the past. But every single orc in that cave immediately recognises it on sight!