# Diagnosing prefab patch problems

Start with the authoring Inspector, then the effective preview, then `pm_summary.log`. Each stage answers a different question.

## The JSON does not compile

Select the root `PrefabPatchAuthoringMetadata` component and click **Compile JSON Now**. The Inspector and Console list the invalid override.

Common causes:

* an added GameObject has no `PrefabPatchAuthoringObjectId`
* two added objects use the same ID
* a referenced asset is neither linked nor a mod-owned Addressables entry
* the variant is not based directly on a Redux SDK linked prefab
* the selected `Mod` asset has no all-assets Addressables group
* a component type cannot be resolved
* an override cannot be represented by the current schema

Fix the variant; do not edit the generated JSON.

## The preview fails

**Open Effective Prefab Preview** resolves all known patches for the target. Failures here usually mean a missing target, stale stock structure, unresolved reference, dependency cycle, or cross-patch target without `NeedsPatch`.

If the linked stock prefab changed after an SDK/game update, refresh or recreate the linked asset and recompile the patch.

## It works in preview but not in game

Check the **Prefab Patches** section of `pm_summary.log`. Use the part for the feature set of the campaign that you tested. The summary has one part for each feature set that the session patched.

Confirm:


1. your mod and all features in the **Required Features** of the patch are on in that campaign, and all features in **Excluded Features** are off. If the feature set does not allow the patch, the plan does not include the patch;
2. the manifest was discovered under your mod's prefab-patch label;
3. the patch was not removed by a missing need or active conflict;
4. the resolved plan is valid;
5. the game requested the Addressables key you patched;
6. composition did not fail.

An `APPLIED`-style result means the plan ran, not necessarily that the game used the field in the way you expected. Test the actual feature that instantiates the prefab.

## Another mod overwrites the change

Two different writes to the same property are reported as a soft conflict. The later deterministic operation wins.

Do not jump straight to Late/Last. Put both patches in the same pass and bucket and use `AfterPatch` against the specific patch when possible.

## A custom component is missing

Make sure the assembly containing the component is part of the installed mod and that the owning mod is declared as a dependency. The component type must be available before the prefab is composed.

## Useful identifiers

Keep the full patch ID, operation ID, target address, and diagnostic code when reporting a problem. Prefab diagnostic codes start with `PM-PREFAB-` and make it much easier to locate the failing stage.