Just talk to them over the table about this spoiling the enjoyment. I had a version of this problem in my TOR table, where one of my players was playing an elf so he was looking up Tolkien lore through chatgpt so his character was appropriately knowledgeable, as an elf erudite should be. IMO this is awesome, but at one point I had to ask him to stop by clearly saying "hey, this stuff we are playing now is strictly from the RPG books, so looking it up will spoil some stuff" or "your character should know this and that about who these guys are". Works out great
RPG
Discussion of table top roleplaying games.
Only play with people who can't read. They have to believe what you tell them
I homebrew everything these days, but back when I ran off-the-shelf adventures, I customized and arranged large parts of them as well. I didn't do it to catch cheaters, but it would be very good for that.
Anyway, I just told players not to read outside sources and be careful about what you search for. I said if you come across outside information once, I'll chalk it up to an accident, but if it happens repeatedly, I'll remove you from the group. I didn't feel the need to explain or justify that.
I had one case of someone searching a name to figure out the spelling, and they ended up spoiling themselves for a major character reveal. They were a good player and they regretted spoiling it for them themselves, and it never happened again.
Counter question, does it matter? If they have fun by knowing what's coming and being able to prepare for it does that make the experience worse for other players or yourself? If not then who cares let them have at it.
If yes then you need to address it somehow, the usual answer to these sorts of things is to just have an adult conversation with the players about expectations.
If you know your players and that won't work then you have some choices to make, again do you care enough to put in more work on top of already running the game?
If it's going to be an issue and they will abuse access to the module even after you've asked them not to, do you really want to play with them?
If the answer is still yes then I suggest altering things slightly so them having pre knowledge doesn't help, locations of key stuff, attitudes of NPCs, stat blocks/ monsters and enemy placement could all be changed pretty easily with fairly little work, I'd definitely rework the monsters at least, I wouldn't go as far as traps designed to catch them out though that's punishing the party for a player.