I'm having a problem with gameplay. CAS is fine with everything, but when I try to play the actual game it freezes up and gives me the error code. I checked all my mods and there seem to be no problems there, even though removing the entire mods folder fixes the problem. I do have a lot of mods so doing each mod individually. would be a waste of time. I already checked other people asking this question, but they all seem to be from the seasons patch from a while ago which won't really help.
This error is caused by outdated mods or custom content that may still be in game or have been removed from the game.
You mention removing the mods folder, did you delete the game cache and and delete the localthumbcache.package from the Sims 4 folder to help with troubleshooting.
How to Delete Cache Files
We've had game updates since Seasons release. It may be a good idea to go through your mods folder again to make sure everything is up to date and in working order.
Custom content can become outdated with most new game patches. If the game works when the Mods folder is removed, then one or more of the mods and/or custom content has become outdated and will need to be removed or replaced. EA/Maxis aren't responsible for broken mods/cc. It's up to the creators to fix.
Disabling or turning off both mod/cc options isn't enough of a test.
Try the 50/50 method:
1. Move all the mods and cc out into a temporary folder on the desktop.
2. Move a few files back at a time. Load the game to make sure it loads and everything is good.
3. Delete the localthumbcache.package from the Sims 4 folder.
4. Repeat steps 1 - 3 till there is no more files to check.
** While your testing, don't save the game. If you find any problems, delete the mod or custom content file.
How To Find Problem Mods and CC