CompilerResultsLog: ERROR: Expecting to find a type to be declared in a module rules named 'AdvancedSessions'

ahhh thank you so much for this fix. I was freaking out for a second.

This worked for me. But Instead of Copying the Plugins, I removed the Plugins from the Engine Plugins Folder, and copied it into the Projects Plugins Folder (Usually within the Contents Folder). So removing it from the engine Plugins folder was necessary, or else it would still give an error. Restart the engine after moving the folders btw!

Just adding my two cents here. It happened to me because a module was not expected to be compiled on the client, whereas it’s expected for the server.

The error message I encountered was:

Expecting to find a type to be declared in a module rules named 'HttpServer' in UE5Rules

I resolved this situation by adding the module in my PROJECT.build.cs:

if (Target.bWithServerCode)
{
    PrivateDependencyModuleNames.AddRange(new string[] { "HttpServer" });
}

And I surrounded the code with:

#if UE_SERVER
#include "IHttpRouter.h"
#include "HttpPath.h"
#include "HttpServerModule.h"
#endif

This resolved the compilation issue for me.