Replicated Variables Crash

I’m seeing a lot of crashes with the message below when I add new Replicated variables to a class.

Basically, it doesn’t like when I add new replicated variables to a class. The way to fix it is to delete the binaries and intermediate and regenerate C++ classes.

However, this is an annoying problem that’s popped up with UE5, and was never there in earlier engine versions. Is there a better fix for this, or does it deserve a bug report?

Thanks!

Assertion failed: bIsValid [File:F:\UE Projects\MyProject\Intermediate\Build\Win64\UnrealEditor\Inc\MyProject\BaseMob.gen.cpp] [Line: 262] UHT Generated Rep Indices do not match runtime populated Rep Indices for properties in ABaseMob

UnrealEditor_MyProject_patch_0!ABaseMob::ValidateGeneratedRepEnums() [F:\UE Projects\MyProject\Intermediate\Build\Win64\UnrealEditor\Inc\MyProject\BaseMob.gen.cpp:262]
UnrealEditor_CoreUObject!UClass::SetUpRuntimeReplicationData() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\Class.cpp:4371]
UnrealEditor_CoreUObject!UClass::SetUpRuntimeReplicationData() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\Class.cpp:4296]
UnrealEditor_KismetCompiler!FKismetCompilerContext::FinishCompilingClass() [D:\build\++UE5\Sync\Engine\Source\Editor\KismetCompiler\Private\KismetCompiler.cpp:3014]
UnrealEditor_Kismet!FBlueprintCompilationManagerImpl::FastGenerateSkeletonClass() [D:\build\++UE5\Sync\Engine\Source\Editor\Kismet\Private\BlueprintCompilationManager.cpp:2922]
UnrealEditor_Kismet!FBlueprintCompilationManagerImpl::FlushCompilationQueueImpl() [D:\build\++UE5\Sync\Engine\Source\Editor\Kismet\Private\BlueprintCompilationManager.cpp:922]
UnrealEditor_Kismet!FBlueprintCompilationManagerImpl::CompileSynchronouslyImpl() [D:\build\++UE5\Sync\Engine\Source\Editor\Kismet\Private\BlueprintCompilationManager.cpp:267]
UnrealEditor_Kismet!FBlueprintCompilationManager::CompileSynchronously() [D:\build\++UE5\Sync\Engine\Source\Editor\Kismet\Private\BlueprintCompilationManager.cpp:3158]
UnrealEditor_UnrealEd!FKismetEditorUtilities::CreateBlueprint() [D:\build\++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\Kismet2\Kismet2.cpp:507]
UnrealEditor_GameProjectGeneration!SNewClassDialog::FinishClicked() [D:\build\++UE5\Sync\Engine\Source\Editor\GameProjectGeneration\Private\SNewClassDialog.cpp:1130]
UnrealEditor_GameProjectGeneration!TBaseSPMethodDelegateInstance<0,SNewClassDialog,1,void __cdecl(void),FDefaultDelegateUserPolicy>::ExecuteIfSafe() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Public\Delegates\DelegateInstancesImpl.h:307]
UnrealEditor_AppFramework!SWizard::HandleFinishButtonClicked() [D:\build\++UE5\Sync\Engine\Source\Runtime\AppFramework\Private\Widgets\Workflow\SWizard.cpp:303]
UnrealEditor_AppFramework!TBaseSPMethodDelegateInstance<0,SWizard,1,FReply __cdecl(void),FDefaultDelegateUserPolicy>::Execute() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Public\Delegates\DelegateInstancesImpl.h:290]
UnrealEditor_Slate!SButton::ExecuteOnClick() [D:\build\++UE5\Sync\Engine\Source\Runtime\Slate\Private\Widgets\Input\SButton.cpp:464]
UnrealEditor_Slate!SButton::OnMouseButtonUp() [D:\build\++UE5\Sync\Engine\Source\Runtime\Slate\Private\Widgets\Input\SButton.cpp:389]
UnrealEditor_Slate!<lambda_51e270ca99ea7ce852539efd04dd453f>::operator()() [D:\build\++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\Application\SlateApplication.cpp:4961]
UnrealEditor_Slate!FEventRouter::Route<FReply,FEventRouter::FToLeafmostPolicy,FPointerEvent,<lambda_51e270ca99ea7ce852539efd04dd453f> >() [D:\build\++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\Application\SlateApplication.cpp:405]
UnrealEditor_Slate!FSlateApplication::RoutePointerUpEvent() [D:\build\++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\Application\SlateApplication.cpp:4947]
UnrealEditor_Slate!FSlateApplication::ProcessMouseButtonUpEvent() [D:\build\++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\Application\SlateApplication.cpp:5495]
UnrealEditor_Slate!FSlateApplication::OnMouseUp() [D:\build\++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\Application\SlateApplication.cpp:5460]
UnrealEditor_ApplicationCore!FWindowsApplication::ProcessDeferredMessage() [D:\build\++UE5\Sync\Engine\Source\Runtime\ApplicationCore\Private\Windows\WindowsApplication.cpp:2210]
UnrealEditor_ApplicationCore!FWindowsApplication::DeferMessage() [D:\build\++UE5\Sync\Engine\Source\Runtime\ApplicationCore\Private\Windows\WindowsApplication.cpp:2699]
UnrealEditor_ApplicationCore!FWindowsApplication::ProcessMessage() [D:\build\++UE5\Sync\Engine\Source\Runtime\ApplicationCore\Private\Windows\WindowsApplication.cpp:1078]
UnrealEditor_ApplicationCore!FWindowsApplication::AppWndProc() [D:\build\++UE5\Sync\Engine\Source\Runtime\ApplicationCore\Private\Windows\WindowsApplication.cpp:916]

Are you compiling in IDE or in the Engine?
Just yesterday I created some classes with replicated variables (in 5.0.1) and everything compiled just fine.