# Blueprint struct variable, error on recompile

**URL:** <https://forums.unrealengine.com/t/blueprint-struct-variable-error-on-recompile/338036>\
**Category:** Editor Scripting\
**Tags:** error, ustruct, recompile, unreal-engine, Blueprint, question, structs\
**Created:** [November 10, 2015, 4:14pm UTC](https://forums.unrealengine.com/t/blueprint-struct-variable-error-on-recompile/338036 "2015-11-10T16:14:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ungalyant](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ungalyant](https://forums.unrealengine.com/u/Ungalyant)\
**Post date:** [November 10, 2015, 4:14pm UTC](https://forums.unrealengine.com/t/blueprint-struct-variable-error-on-recompile/338036/1 "2015-11-10T16:14:39Z")

</div>

I’m having an incredibly time consuming and frustrating issue which using C++ declared (but Blueprint Type marked) structs in blueprint. My struct looks like this:

```
USTRUCT(BlueprintType)
struct FDataFile
{
	GENERATED_USTRUCT_BODY()

	UPROPERTY(BlueprintReadWrite, Category = DataFiles)
		float fileSize;
	UPROPERTY(BlueprintReadWrite, Category = DataFiles)
		FString fileName;
	UPROPERTY(BlueprintReadWrite, Category = DataFiles)
		FString fileContents;
	UPROPERTY(BlueprintReadWrite, Category = DataFiles)
		TSubclassOf<UUserWidget> fileType;

	FDataFile()
	{
	}
};

```

The issue I’m having is that whenever I make any edit in the C++ script this struct is delcared in (either to the struct itself or the class in the same .h file) and then recompile (this is using compile from editor, so a hot reload in case that matters), every struct I have as a blueprint variable errors with the message “The variable _variableX_ in _blueprintY_ has an invalid type Array of Structures” (In this case it’s an array, but the same happens for single struct variables.) Meaning I have to completely redeclare the variable and remake any links or functions it was being used in.

---

<div class="post-metadata">

**Author:** ![Distul](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Distul](https://forums.unrealengine.com/u/Distul)\
**Post date:** [November 10, 2015, 5:22pm UTC](https://forums.unrealengine.com/t/blueprint-struct-variable-error-on-recompile/338036/2 "2015-11-10T17:22:41Z")

</div>

I’m not using cpp with my project but there is a similar error you get when modifying structures or array structures in blueprints.

First I’d like to confirm that you’re not trying to use an array structure within an array – the engine seems to have a ton of issues with this.

Moving on: If you make a change to your structure or have try going into every blueprint that uses the structure and save/compile. May fix your issue, here’s to hoping.

---

<div class="post-metadata">

**Author:** ![Ungalyant](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ungalyant](https://forums.unrealengine.com/u/Ungalyant)\
**Post date:** [November 10, 2015, 5:27pm UTC](https://forums.unrealengine.com/t/blueprint-struct-variable-error-on-recompile/338036/3 "2015-11-10T17:27:33Z")

</div>

Hey Distul,

Thanks for coming with some answers.

No I’m not using arrays within arrays (although my structure itself does contain a TArray, would that matter?) but the array of structures in the blueprint is on its own.

I have tried compiling the scripts, but the errors persist. I found a similar issue:

> **[When I re-compile project code, blueprint variables with types I have defined...](https://forums.unrealengine.com/questions/280404/when-i-re-compile-project-code-blueprint-variables.html)**
>
> I have a custom struct type that I have defined in a c++ source file hooked up to my Unreal project. Occasionally when I re-compile my code through the Unreal Editor, all variables in my blueprints with that struct as their type will disappear form...

Which seems to suggest I just shouldn’t hot reload. I will try that for a while and see if I continue to get no errors.

---

<div class="post-metadata">

**Author:** ![Ungalyant](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ungalyant](https://forums.unrealengine.com/u/Ungalyant)\
**Post date:** [May 2, 2016, 12:12pm UTC](https://forums.unrealengine.com/t/blueprint-struct-variable-error-on-recompile/338036/4 "2016-05-02T12:12:28Z")

</div>

This issue seems to have been fixed by subsequent builds, I’m now on 4.11
