# \[UBT Bug\] No longer able to compile plugins in standalone since 5.3

**URL:** <https://forums.unrealengine.com/t/ubt-bug-no-longer-able-to-compile-plugins-in-standalone-since-5-3/1318659>\
**Category:** Pipeline & Plugins\
**Tags:** unreal-engine, ubt, Plugins\
**Created:** [October 1, 2023, 11:57am UTC](https://forums.unrealengine.com/t/ubt-bug-no-longer-able-to-compile-plugins-in-standalone-since-5-3/1318659 "2023-10-01T11:57:54Z")\
**Posts on this page:** 1\
**Showing post:** 20

<div class="post-metadata">

**Author:** ![teemujin](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/teemujin/32/1066529_2.png) [@teemujin](https://forums.unrealengine.com/u/teemujin)\
**Post date:** [May 22, 2025, 3:50am UTC](https://forums.unrealengine.com/t/ubt-bug-no-longer-able-to-compile-plugins-in-standalone-since-5-3/1318659/20 "2025-05-22T03:50:04Z")

</div>

Should we push this on Unreal Engine build tool bug reports ? ( with help from gpt.. so it may be hallucinating… check me if you see anything wrong .. )

## 🐞 Bug: UnrealBuildTool Crashes During `BuildPlugin` When `SupportedTargetTypesAttribute` Is Missing

### Summary

Starting in **Unreal Engine 5.3** and continuing through **5.4 and 5.5** , `UnrealBuildTool` crashes when using the `BuildPlugin` command on plugins that do **not define** a `[SupportedTargetTypes]` attribute on their `ModuleRules` class.

This results in an `ArgumentNullException` and is especially disruptive to plugin developers and IDE tooling like **JetBrains Rider** , which uses `BuildPlugin` as part of its integration workflow.

* * *

### Reproduction Steps

1. Create or install a plugin whose `*.Build.cs` file does **not** declare `[SupportedTargetTypes]`.

2. Run the following command:

3. Observe the crash in UBT:

* * *

### Root Cause

UBT tries to reflect over the `ModuleRules` class using:

```csharp
var supportedTargetTypes = moduleType
    .GetCustomAttributes<SupportedTargetTypesAttribute>()
    .SelectMany(x => x.TargetTypes)
    .Distinct();

```

If the attribute is missing, this throws a `NullReferenceException` or `ArgumentNullException`.

* * *

### Proposed Fix (Works in Practice)

Patch `UnrealBuildTool\Configuration\ModuleRules.cs` by wrapping the call in a safe `try/catch`:

```csharp
IEnumerable<TargetType> supportedTargetTypes = new TargetType[] { };
try
{
    supportedTargetTypes = moduleType
        .GetCustomAttributes<SupportedTargetTypesAttribute>()
        .SelectMany(x => x.TargetTypes)
        .Distinct();
}
catch
{
    string moduleName = moduleType?.Name ?? "<null>";
    invalidReason = $"TargetType '{targetRules.Type}' : Failed to get SupportedTargetTypesAttribute from '{moduleName}'";
    return false;
}

```

This logs the issue but **avoids the crash** and allows the toolchain to continue.

* * *

### Why This Matters

- This **breaks plugin compilation** for otherwise valid code.
- It affects **Rider** , **automated build pipelines** , and **tools that depend on `BuildPlugin`**.
- Plugin authors may not know they need to explicitly declare `[SupportedTargetTypes]` and shouldn’t be penalized for its omission.
- The crash is **non-informative** and doesn’t indicate the actual problem.

* * *

### Workaround

Manually patch and recompile UBT:

1. Open:

2. Edit:

3. Patch the `IsValidForTarget` method as above.

4. Build the solution and replace the generated DLL:

* * *

### Request

Please update UBT in the next engine release (5.5.2 or 5.6+) to:

- Handle missing `[SupportedTargetTypes]` gracefully
- Log a clear warning or fallback message
- Avoid `ArgumentNullException` or fatal reflection errors

This will improve developer UX, unblock toolchains, and prevent confusion.

* * *

### References

- [Epic Games Forums - Repro + Fix](https://forums.unrealengine.com/t/ubt-bug-no-longer-able-to-compile-plugins-in-standalone-since-5-3/1318659/11)
- Reproduced and validated in UE 5.5 with RiderLink

---

_[View the full topic](https://forums.unrealengine.com/t/ubt-bug-no-longer-able-to-compile-plugins-in-standalone-since-5-3/1318659)._
