WebSockets module not loaded properly in packaged builds only. Other modules OK

I actually noticed the same thing myself just recently. The answer is quite easy: It’s a bug. The ::Get() method should load the module if it was not loaded before, but it doesn’t. And even worse: It actually dereferences a nullptr in that case.

I made a merge request with a fix for this. In the meanwhile you can just add a line with FModuleManager::Get().LoadModuleChecked("WebSockets"); right before the FWebSocketsModule* wsModule = &FWebSocketsModule::Get(); line to ensure that it is loaded before accessing it.

For tracking, here is the PR: https://github.com/EpicGames/UnrealEngine/pull/9376