Crash when building levels in UE5

Hello everyone , I’m just created a new empty game project in UE5, and run building levels , then crash , I don’t know why , is there anyone solved this problem?

Assertion failed: World.IsValid() [File:D:\build++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\EditorBuildUtils.cpp] [Line: 1172]

UnrealEditor_UnrealEd!FBuildAllHandler::ProcessBuild() [D:\build++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\EditorBuildUtils.cpp:1172]
UnrealEditor_UnrealEd!FEditorBuildUtils::EditorBuild() [D:\build++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\EditorBuildUtils.cpp:502]
UnrealEditor_LevelEditor!FLevelEditorActionCallbacks::Build_Execute() [D:\build++UE5\Sync\Engine\Source\Editor\LevelEditor\Private\LevelEditorActions.cpp:676]
UnrealEditor_LevelEditor!TBaseStaticDelegateInstance<void __cdecl(void),FDefaultDelegateUserPolicy>::ExecuteIfSafe() [D:\build++UE5\Sync\Engine\Source\Runtime\Core\Public\Delegates\DelegateInstancesImpl.h:731]
UnrealEditor_Slate!FUICommandList::ExecuteAction() [D:\build++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\Commands\UICommandList.cpp:99]
UnrealEditor_Slate!SMenuEntryBlock::OnClicked() [D:\build++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\MultiBox\SMenuEntryBlock.cpp:1148]
UnrealEditor_Slate!SMenuEntryBlock::OnMenuItemButtonClicked() [D:\build++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\MultiBox\SMenuEntryBlock.cpp:1108]
UnrealEditor_Slate!TBaseSPMethodDelegateInstance<0,SMenuEntryBlock,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!SMenuEntryButton::OnMouseButtonUp() [D:\build++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\MultiBox\SMenuEntryBlock.cpp:434]
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]
user32
user32
UnrealEditor_ApplicationCore!FWindowsPlatformApplicationMisc::PumpMessages() [D:\build++UE5\Sync\Engine\Source\Runtime\ApplicationCore\Private\Windows\WindowsPlatformApplicationMisc.cpp:138]
UnrealEditor!FEngineLoop::Tick() [D:\build++UE5\Sync\Engine\Source\Runtime\Launch\Private\LaunchEngineLoop.cpp:5139]
UnrealEditor!GuardedMain() [D:\build++UE5\Sync\Engine\Source\Runtime\Launch\Private\Launch.cpp:183]
UnrealEditor!GuardedMainWrapper() [D:\build++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:147]
UnrealEditor!LaunchWindowsStartup() [D:\build++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:283]
UnrealEditor!WinMain() [D:\build++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:330]
UnrealEditor!__scrt_common_main_seh() [d:\a01_work\6\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288]
kernel32
ntdll

Most the errors are just a side product of some logic the editor isn’t liking. What stands out to me here are the “on mouse up” and “on clicked” errors. There is something wrong with some of your UI logic. I suspect it’s either a faulty path or maybe some kind of infinite loop that’s instantiated when the buttons are clicked and draws a ton of ram and crashes. It’s not being picked up until you build…

There’s a quick thing you can rule out and that is clicking on your content folder and clicking “fix up redirectors” and try to build again. If all else fails again track down the on clicked buttons it’s referencing and re-evaluate what you have there. Unfortunately it never really points specifically to the source of the problem. Sometimes structs will compile correctly, but cause issues like this. You can disconnect some functionality that may be suspect and try to build again until it works. It’s tedious if you have a lot of code, but sometimes it takes some time to debug… highlighting some code and pressing F9 you can run it through the debugger and try that…