Three options
In my experience you have three options to handle such situations: Ban, ignore or embrace
Banning is the cheapest solution
Yet effective, just banning a possible problem solver is not very creative.
In my games I handled it more with the "Yes, but"-approach.
Ignore the problem
If you know your party can solve problems like a chasm with a Fly spell, don't give them such problems to solve or at least don't account much effort on those situations.
Embrace it
This is actually a tough one and needs sometimes a lot of work in preparation.
In my games I handled skills and abilities that are able to solve problems, with mini-games... small puzzles or logic games. I flat out banned any ability throws or spells to solve those puzzles immediately... BUT every ability check or spell were rewarded with tips or different measures that lowered the difficulty.
For example: You have this ancient text you could decipher either with a spell or with a History check (or something comparable). As Comprehend Languages is a spell specially designed for such situations, it should give the players a bigger advantage than a success on an Intelligence check. But you still don't have to give them the deciphered information. You could give them the translated text as a handout in a very strange font that is incredible hard to read. So the text is translated, but the players still have to decipher it personally. Alternatively you could have a text (because you know that your wizard is able to cast Comprehend Languages pretty early... at least in most cases) that is a puzzle itself... A strange poem that has a secret hidden message for example.
I had such a text in one of my campaigns. It was the classic trope of strange verses that gave some hints how to find the McGuffin. At first they had to decipher the text... but the parchment was ripped apart and partly scorched, so they could understand the text, but still had to put it back together... and then they had a puzzle text. I literally printed a text in a handwriting font, tore that handout apart and scorched the pieces. Than I gave those pieces to the party... they hated me a little bit when I said "...and you find this in the ashes of the fire place..." and shove that pile of half burned mess over the table. XD
But after they solved it, they actually liked that puzzle.
TL;DR: Give your players all the abilities, but adapt your puzzles to their skillsets. Let them feel an advantage, that isn't really one. As a DM you know (or at least should know) what your players are capable of. Design your puzzles with that in mind. Comprehend Languages cannot right out solve a puzzle, you just have to design your puzzle around that spell. Of course, it's a limitation of what you can do as a DM to give your players a challenge, but isn't that what DMing is all about?