Blueprint saving engine/transient error

Similar to this question, Can't save due to "Graph is linked to external private object" - C++ - Unreal Engine Forums, though this time it is a blueprint that can not be saved because of a empty C++ static function (or not empty, any static function will cause this bug). I’m a bit new to unreal engine c++ programming, so this might be a problem with my code, if so, please tell me.
The code used:
(header)

#include "Kismet/BlueprintFunctionLibrary.h"
#include "MyBlueprintFunctionLibrary.generated.h"

/**
 * 
 */
UCLASS()
class TESTPROJECT_API UMyBlueprintFunctionLibrary : public UBlueprintFunctionLibrary
{
	GENERATED_BODY()
	
	
public:
	UFUNCTION(BlueprintCallable, Category="NotWorking")
		static void StartBug();
};

(cpp)

#include "TestProject.h"
#include "MyBlueprintFunctionLibrary.h"

void UMyBlueprintFunctionLibrary::StartBug()
{
	UE_LOG(LogTemp, Warning, TEXT("Test:"));
}

Steps to reproduce:

  1. Create any static blueprint callable function, then compile.
  2. Make an empty actor blueprint and have it call this function, compile and save this blueprint (shouldn’t show an error at the moment).
  3. Make any change to the c++ function so that it will compile the code again (e.g. change TEXT("Test:") to TEXT("Test2:")), then compile
  4. Make any change to the blueprint containing the function so that will recompile or save, e.g. disconnect and reconnect a node, or just add a print string node.
  5. Attempt to save the blueprint, and the Engine/Transient error will come up (“Graph is linked to private object(s) in an external package, External Object(s): Engine/Transient” – OK → “The asset failed to save”).

I also tested it with an int as the return type, the bug is still there, only way I found to fix this is to delete and place the function again in the blueprint every single time you have to compile any part of any c++ code.

Anyone know a solution for this bug?

Hello Hand_of_Cthulhu,

Thank you for reporting this issue. I tested this with your repro and got the same results. I’ve placed a bug in for the issue here and also noticed that this is new to 4.13 as it didn’t occur in 4.12.5. You can find the bug here: UE-36428

Unfortunately I can’t think of any other workaround at the moment other than replacing the node each time.

Also, I noticed that this only happens with Blueprint Function Libraries, as when I did this inside of a Actor class, the issue did not occur.

In case it offers more insight - I have a simple test map with a call to a newly added blueprint function library, invoked in the level blueprint. It is important to note that this level was saved successfully using a manual save after adding this.

Now, even on subsequent boots of the editor (using the previously saved level), this issue now triggers for me with a 100% reproduction rate whenever an autosave occurs. Manual saves appear to be unaffected prior to this auto save (I can move an actor and trigger a manual save without issue), but is broken after the autosave. Deleting the nodes and recreating solve the problem as suggested - and allows a manual save again. But a subsequent auto save will trigger the issue once more. I’ve had to disable auto save in the meantime.