# Diagnostics

> Aego 0.12.5 · development; docs build `4a32b816933e02930662f6a443cb25abe6050d090c55e237cbff5c44ae9b25f8`. [Build manifest](/docs-build.json).

Every code the compiler, the script runtime and the engine report, with what it means and how to fix it.

## AES1001

This character cannot appear here.

Fix: Use ASCII letters for names, put other text inside a string, and use && or || instead of & or |.

## AES1002

The string literal has no closing quote.

Fix: Add " at the end of the string.

## AES1003

The escape sequence after \ is not supported.

Fix: Use \n, \t, \", \\ or \uXXXX.

## AES1004

The word is reserved for a future version of the language.

Fix: Rename the identifier.

## AES1005

The number literal is malformed.

Fix: Write digits after the point (1.0, not 1.) and separate digits with _ only between digits.

## AES1006

The block comment has no closing */.

Fix: Add */ where the comment should end.

## AES1007

The file contains bytes that are not valid UTF-8.

Fix: Save the file as UTF-8.

## AES1008

A string literal cannot span lines.

Fix: Close the string on the same line or use \n.

## AES1101

The parser expected something else at this point.

Fix: Check for a missing bracket, comma or operator right before this position.

## AES1102

Every script file starts with a package clause.

Fix: Add `package <directory name>` as the first line.

## AES1103

Attributes are allowed only on scripts and script fields.

Fix: Move the attribute above a script or a `var` inside a script, or remove it.

## AES1104

Imports must come before any declaration.

Fix: Move the import to the top of the file, after the package clause.

## AES1105

Packages cannot hold mutable state.

Fix: Use const for fixed values, or move the variable into a script as a field.

## AES1106

Types, functions and constants are declared at package level.

Fix: Move the declaration out of the function body.

## AES1107

The left side of := must be one new name.

Fix: Write `name := value`, or use = to assign to an existing field or element.

## AES1108

A composite literal key must be a field name.

Fix: Write `Type{Field: value}`.

## AES1109

The code is nested too deeply.

Fix: Split the expression or block into helper functions.

## AES1110

The single part of a for loop must be a condition.

Fix: Write `for cond {}` or `for init; cond; post {}`.

## AES1111

A slice type here must be followed by a literal.

Fix: Write `[]T{...}`.

## AES1112

Only one value can be assigned per statement.

Fix: Split the assignment into several statements.

## AES1113

else must follow the closing brace on the same line.

Fix: Write `} else {`.

## AES2001

The name is not declared in this scope.

Fix: Check the spelling, declare it, or add the missing import.

## AES2002

The name refers to something that is not a type.

Fix: Use a type name such as int, Vec2 or a declared struct.

## AES2003

The value has a different type than the place it is used.

Fix: Convert explicitly, for example float(x) or int(f).

## AES2004

The operator is not defined for these operand types.

Fix: Convert the operands to a type the operator supports.

## AES2005

The call passes a different number of arguments than the function expects.

Fix: Match the function signature; hover the function to see it.

## AES2006

The expression is not a function.

Fix: Remove the parentheses or call a function instead.

## AES2007

The left side cannot be assigned to.

Fix: Assign to a variable, field, slice element or writable component field.

## AES2008

The type has no field or member with this name.

Fix: Check the spelling; press Ctrl+Space after . to see the members.

## AES2009

The name starts with a lowercase letter, so it is private to its package.

Fix: Rename it to start with an uppercase letter if other packages need it.

## AES2010

A constant needs a value known at compile time.

Fix: Use literals and other constants only.

## AES2011

Integer division by a constant zero.

Fix: Check the divisor.

## AES2012

The constant does not fit its type.

Fix: Use a smaller value or a wider type.

## AES2013

The function can reach its end without returning a value.

Fix: Add a return statement on every path.

## AES2014

break or continue is outside a loop or switch.

Fix: Move it inside a for loop, or use return.

## AES2015

A switch on an enum must handle every member.

Fix: Add the missing cases or a default.

## AES2016

The same case value appears twice.

Fix: Remove the duplicate case.

## AES2017

A struct cannot contain itself by value.

Fix: Store the relation in a slice or remove the field.

## AES2018

The name is already declared in this scope.

Fix: Rename one of the declarations or remove one of them.

## AES2019

The returned value does not match the function result.

Fix: Return a value of the declared type, or none in a function without a result.

## AES2020

nil has no type of its own here.

Fix: Give the variable an explicit reference type: `var r NodeRef = nil`.

## AES2021

The type argument is not valid here.

Fix: Use Get<T>/Has<T> with a component name, AssetRef<Texture|Scene|Prefab|Mesh>.

## AES2022

A lifecycle method has the wrong signature.

Fix: Use func Ready(), func Update(dt float), func FixedUpdate(dt float), func Reloaded().

## AES2023

These types cannot be converted into each other.

Fix: Convert through int, float or string as documented.

## AES2024

The expression does not produce a value.

Fix: Call the function, or use a value instead of a type or package.

## AES2025

The value is computed and then thrown away.

Fix: Assign the result or remove the expression.

## AES2026

Constants refer to each other in a cycle.

Fix: Break the cycle with a literal value.

## AES2027

Constants can only be bool, int, float, string or enum.

Fix: Use a script field for other types.

## AES2028

The composite literal does not fit its type.

Fix: Use all keyed or all positional values, with the right count.

## AES2029

The function is too large to compile.

Fix: Split it into smaller functions.

## AES2030

The package was not built because a dependency has errors.

Fix: Fix the errors in the named package.

## AES2031

The variable is declared but never read.

Fix: Use it or remove it.

## AES2032

Slice elements may occupy at most 32 value slots.

Fix: Make the element struct smaller or store several slices.

## AES2050

yield suspends a coroutine, so it is allowed only inside a function declared as coroutine.

Fix: Declare the method as func Name() coroutine and start it with start Name().

## AES2051

A coroutine cannot be called like a plain function.

Fix: Write start Name(args); keep the result in a Coroutine field to stop it later.

## AES2052

start runs a coroutine method of the current script.

Fix: Mark the method with coroutine after its signature, or call a plain method directly.

## AES2053

A coroutine is a script method and returns no value.

Fix: Move it into a script and remove the result type; pass results through fields or signals.

## AES2054

The handler parameters must match the signal parameters exactly.

Fix: Change the handler to take the same types in the same order as the signal.

## AES2055

Connect takes a plain method of this script or ref.Method; signals are emitted only by their own script.

Fix: Pass a method name like OnDied or other.OnDied; call Emit only on a signal of this script.

## AES2056

Ready, Update, FixedUpdate and Reloaded are called by the engine and cannot be coroutines.

Fix: Keep the lifecycle method plain and write start Name() inside it.

## AES2057

wait and waitUnscaled take seconds as float, frames and fixed take a count as int, a bare yield value must be a Coroutine.

Fix: Convert the value, for example yield wait(float(n)) or yield frames(int(t)).

## AES2058

ScriptRef and GetScript need the name of a script type.

Fix: Use the script name, or pkg.Name when the short name is ambiguous.

## AES2059

Lifecycle methods and coroutines run only on their own instance.

Fix: Call a plain method of the target that does the work, or connect to a signal.

## AES2060

A script method named after an engine event receives that event and must match its signature.

Fix: Use the parameter types shown in the hover for the event, or rename the method if it is not meant to be a handler.

## AES2061

Engine event handlers are called only by the engine.

Fix: Move the shared code into a plain method and call that from the handler and from your code.

## AES3001

Only scalar, vector, enum and reference fields can be exported.

Fix: Remove @export or change the field type.

## AES3002

The attribute is not known.

Fix: Use @export, @former, @hide or @pause.

## AES3003

The attribute argument is not valid.

Fix: See the attribute in the Script Reference; hover it for the accepted arguments.

## AES3004

The attribute or argument is given twice.

Fix: Keep one.

## AES3005

The attribute does not apply to this declaration.

Fix: Move it to a script or field, or remove it.

## AES3006

A field default must be a constant.

Fix: Use a literal or constant, or set the value in Ready.

## AES3007

Only scalar, vector, enum, node and asset fields can be saved.

Fix: Remove @persist and save the value in OnSave instead.

## AES4001

The package clause must match the directory name.

Fix: Rename the package clause or move the file.

## AES4002

No script package or engine module has this path.

Fix: Check the path; script packages are directories under scripts/.

## AES4003

The package is imported twice.

Fix: Remove one import.

## AES4004

A package cannot import itself.

Fix: Remove the import.

## AES4005

Packages import each other in a cycle.

Fix: Move the shared code into a third package.

## AES4006

The name is declared twice.

Fix: Rename or remove one declaration.

## AES4007

An import uses the same name as a declaration.

Fix: Rename the declaration.

## AES4008

The import is not used.

Fix: Remove it.

## AES4009

Package paths under aego/ belong to the engine.

Fix: Change the project module.

## AES4010

A script package and an engine module share the same path.

Fix: Rename the script directory.

## AES5001

The engine or native module has no such member.

Fix: Check the name; press Ctrl+Space after the module name to list members.

## AES6001

The callback ran more instructions than its budget, usually an endless loop.

Fix: Make sure every loop ends within one frame.

## AES6002

A native Go binding panicked.

Fix: Fix the Go function; the Console shows its stack.

## AES6003

Calls nested more than 256 levels, usually endless recursion or re-emitting a signal from its handler.

Fix: Add a stopping condition.

## AES6004

A reference is nil or its node, component or script instance no longer exists.

Fix: Check `if ref != nil` and IsAlive before use.

## AES6005

The slice index is outside the slice.

Fix: Check the index against len(slice).

## AES6006

Integer division by zero at runtime.

Fix: Check the divisor before dividing.

## AES6007

A string or slice handle is invalid.

Fix: Report this as an engine bug.

## AES6008

A function reached its end without returning.

Fix: Add the missing return.

## AES6009

A call or binding could not be linked.

Fix: Rebuild the scripts and native code.

## AES6010

An engine or native function reported an error.

Fix: Read the message; it names the cause.

## AES6100

A compiled artifact is corrupt.

Fix: Reimport the scripts (Assets → Reimport).

## ANC001

A transition has a condition on a parameter the controller does not declare, or with an operator its kind does not have: `gt`, `ge`, `lt` and `le` compare `int` and `float` parameters, a `bool` takes `eq` and `ne` or no operator, a `trigger` takes no operator.

**Fix.** Declare the parameter with `param "Name" kind=…`, or change the operator to one its kind has.

## Details

The controller keeps its last good version.

## ANC002

The entry, or the source or target of a transition, names a state the controller does not declare, or the controller has no states.

**Fix.** Declare the state with `state "Name" …`, or fix the name; a transition from every state is written `transition "any" to="…"`.

## Details

The controller keeps its last good version.

## ANC003

A transition goes from a state into the same state and has no `exitTime`.

**Fix.** Give the transition an `exitTime`, for example `exitTime=1` to restart after one pass of the clip, or remove it.

## Details

Its conditions would restart the state on every step they hold, so the clip never gets past its first frame.

## ANC004

A state names a clip that is not imported, or the clip failed to import.

**Fix.** Import the clip or pick another one for the state.

## Details

The state still works in the graph, with its transitions and exit times, but it plays nothing: the properties keep the values the last state gave them.

During Play the same code is logged once per state.

## ANC005

Transitions without duration, conditions or exit time lead from one state back to it, directly or through other states.

**Fix.** Give one transition of the loop a condition, an `exitTime` or a `duration`.

## Details

Each step would run around the loop until the limit of eight transitions per step. The controller keeps its last good version.

## ANC006

The controller text has something the importer does not know: an unknown block, attribute or field, an attribute written as a field inside the block (or the other way round), or a value of the wrong type.

**Fix.** Correct the line the message names.

## Details

Nothing is ignored silently, so a misspelt setting never vanishes. The message names the line and, for a setting in the wrong place, shows how to write it. The controller keeps its last good version.

The blocks and their settings are listed in [Controllers](/animation/controller.md).

## ANM001

The clip has something the importer cannot read: a kind that does not animate, such as `string`, a key value that does not match the kind, or an unknown block, attribute or field.

**Fix.** Give the track one of the kinds in [Clips](/animation/clips.md), and check that the property path names a field of a component on the target node.

## Details

Nothing is ignored silently: an attribute written as a field inside its block, such as `start` inside `frames`, is refused with the line to write instead (`frames "Slash" start=0.08 {`). The clip keeps its last good version.

During Play the same code is logged when a track's property does not exist on its node or has another type than the track's `kind`; that track is off and the rest of the clip plays.

## ANM002

A key or an event has a time below 0 or past the clip's length, or the length is not positive.

**Fix.** Move the key inside the clip or make the clip longer.

## Details

The clip keeps its last good version.

## ANM003

The clip has an event whose name is not declared in Project Settings → Animation.

**Fix.** Declare the event in the `animation` section of the project, or rename it in the clip to a declared one.

## Details

The event never runs; the rest of the clip plays.

## ANM004

A track animates a property that something else already drives: another track of an animation, or Motion 2D, which moves the position and rotation of its node.

**Fix.** Animate a child node instead of the node with Motion 2D, or remove one of the two tracks.

## Details

The later track is off, so the property never gets two values in one step.

It appears during Play, when the clip is bound to the scene.

## ANM005

The node path of a track does not lead to a node under the player, so the track is off.

**Fix.** Rename the node back, or change the track's path in the clip.

## Details

A renamed or deleted child is the usual cause.

It appears during Play, when the clip is bound to the scene; it is checked again when the hierarchy changes.

## ANM006

A track animates the transform of a node with a physics body that moves on its own.

**Fix.** Animate a kinematic body with `authority=simulation`, so the animation moves it with its velocity; animate a child node for a body that physics moves.

## Details

On a dynamic body every transform track is off. On a kinematic body a track with `authority=presentation` is off, because physics draws that body. A static body is moved, with a warning: it is teleported on every step.

It appears during Play, when the body exists.

## ANM007

An Animation Player with Time Domain `unscaled` plays a clip with `authority=simulation` tracks or `gameplay` events.

**Fix.** Use Time Domain `game` for animation that changes the game, or make the tracks presentation and the events `presentation`.

## Details

Unscaled players run in real time and are not part of the game state, so those tracks are off and the events arrive as presentation events.

## ANM008

A clip was imported again during Play and its tracks changed: there are more or fewer, or a track has another node, property or kind.

**Fix.** Play the clip again, or restart Play.

## Details

The players of that clip stop, because their place in the old clip means nothing in the new one. A clip with the same tracks and other keys or another length keeps playing from the same point.

## ANM009

A clip has a root track, a `transform.position` track with `root=true`, but nothing can move the node with it.

**Fix.** Add Motion 2D to the node, set Root Motion to `toTransform`, or play the clip with an Animator.

## Details

An Animator with Root Motion `toMotion` moves its node through Motion 2D, and this node has none; with Root Fallback the node moves its transform instead, without it the motion is dropped. An Animation Player never plays root motion: the root track is off.

It appears during Play, on the first step that has root motion.

## AUD001

An imported `.wav` or `.ogg` is damaged or uses a format the decoder does not read (WAV must be PCM 8, 16, 24 or 32 bit or float; OGG must be Vorbis).

**Fix.** Export the sound again as 16-bit PCM WAV or Ogg Vorbis.

## Details

The clip plays nothing.

## AUD002

The clip's Loop Start and Loop End are outside the sound or in the wrong order, so the whole sound loops instead.

**Fix.** Open the clip in the Inspector and drag the loop markers inside the waveform, or clear them.

## AUD003

An Audio Source 2D needs a Clip or an Event.

**Fix.** Pick a Clip or an Event.

## Details

With neither it is silent. With both, it plays the Event and ignores the Clip and the playback fields (reported as information).

## AUD004

A spatial Audio Source 2D pans and fades by distance to the active Audio Listener 2D.

**Fix.** Add an Audio Listener 2D to the player or the camera when you want the sound heard from somewhere else.

## Details

The scene has none, so the sound is heard from the camera. This is information, not an error: a game with one camera often wants exactly that.

## AUD005

Only the first active Audio Listener 2D in the hierarchy is used; this one is ignored.

**Fix.** Keep one listener active, for example on the player, and turn Active off on the others.

## AUD006

An Audio Event has no variants, or it is spatial with Max Distance not larger than Min Distance.

**Fix.** Add at least one clip to Variants, and for a spatial event make Max Distance larger than Min Distance.

## Details

Playing it does nothing.

## CAM001

Camera Follow 2D and Camera Shake 2D act on the Virtual Camera 2D of their own node.

**Fix.** Add a Virtual Camera 2D to the node.

## Details

Without one they do nothing.

Add Component adds it on its own when you add Camera Follow 2D.

## CAM002

A Camera Zone 2D switches to a camera while the target is inside its Area.

**Fix.** Pick a virtual camera in Camera, or add a Virtual Camera 2D to the zone node.

## Details

It uses the Camera field or, when that is empty, a Virtual Camera 2D on its own node; with neither it has nothing to switch to.

## CAM003

A Virtual Camera 2D with Use Bounds, or a Camera Zone 2D, has a Bounds or Area rectangle of zero width or height.

**Fix.** Drag the rectangle handles in the Scene View, or turn Use Bounds off.

## Details

A camera is then not clamped, and a zone never triggers.

## CAM004

Camera Follow 2D moves its virtual camera after a node.

**Fix.** Pick the node to follow in Target, usually the player.

## Details

With Target empty the camera stays where it is.

## GMP001

Motion 2D moves its Rigid Body 2D by casting and setting the position each step, so the body must be kinematic.

**Fix.** Set the Type of Rigid Body 2D to kinematic.

## Details

On a dynamic or static body the physics and the controller fight. This error blocks Play.

Adding Motion 2D does this on its own.

## GMP002

In platformer mode Motion 2D derives the jump speed from Jump Height and gravity.

**Fix.** Set Jump Speed, or give the controller a Gravity Scale.

## Details

With Gravity Scale 0 there is no gravity, so the jump speed cannot be derived.

## GMP005

A State Machine has no states, an empty or duplicate state name, or an Initial state that is not in States.

**Fix.** List the states once each, by name, and pick Initial from them (empty starts in the first).

## GMP006

A Hurtbox 2D passes hits to a Health: the one in its Health field, or else the first Health on its node or above it.

**Fix.** Add a Health to the hurtbox node or a parent, or pick one in the Health field.

## Details

This one finds none, so hits on it are ignored. It is a warning because the Health may be added later by a script.

## LGT001

A light is excluded because its type, intensity, range, height or angle is invalid.

**Fix.** Choose a supported type, finite nonnegative intensity and height, positive local range, full Spot angles satisfying `0 <= InnerAngle <= OuterAngle <= pi`, and Directional elevation in `(0, pi/2]`.

## LGT002

Directional lights illuminate surfaces but cannot cast local shadow masks.

**Fix.** Disable Shadows on the Directional light or use a Point, Spot or Sprite light for local shadows.

## LGT003

The output has conflicting environments, invalid settings or an unresolved camera or preview selection.

**Fix.** Select one environment per output with a valid camera, nonnegative ambient, positive exposure, power-of-two shadow resolution from 64 to 2048 and a shadow budget of 0 to 16, or reset a stale Scene View selection.

## LGT004

The shadow contour has unsupported geometry, an invalid source or an unknown culling mode.

**Fix.** Choose a supported source and winding, then use handles to make a simple polygon of 3–256 finite vertices or a nonintersecting open chain with no zero-length edges.

## LGT005

The occluder cannot resolve the owner, geometry provider or shape key of its saved reference.

**Fix.** Restore the owner or provider, select an available shape or draw a manual polygon that works without Physics.

## LGT006

A lighting texture reference is missing or resolves to a texture with incompatible semantics.

**Fix.** Restore the saved AssetID or assign a compatible linear normal or mask, checking the source dimensions and trim of paired frames.

## LGT007

A non-finite or degenerate presentation transform prevents the light or occluder from using its intended orientation.

**Fix.** Check the node and its parents for zero scales or non-finite coordinates in both authored and interpolated poses.

## LGT008

A lighting input exceeds a resource budget, or the requested target cannot represent the lighting output.

**Fix.** Read the reported limit or target reason, then simplify the contours, adjust the light budget, or compose additive energy over an opaque backdrop before display resolve.

## MAT004

A material's shader domain, schema or texture bindings cannot be used by its consumer.

**Fix.** Follow the reported asset and full cause to repair the incompatible assignment or dependency, keeping the intended shader domain and stable references.

## Identify the incompatible assignment

Read the reason after the code. MAT004 is used for a shader-domain mismatch, a missing shader schema or material reference, and unresolved or incompatible texture bindings. Some unresolved references are warnings and are retained; the code alone does not determine whether a file was lost.

Select the Console or Problems entry. Find its asset path or AssetID, then inspect the material's shader and its actual consumer. In a nested [SHD009](/diagnostics.html#SHD009.md), keep the outer driver error and the inner MAT004 reason: they describe different levels of the failure.

| Reason in the message | Correction |
|---|---|
| `postfx shader cannot draw sprite geometry` | Use that material in a camera Post Process Custom effect. Choose a sprite-compatible material for SpriteRenderer; retain the postfx shader's purpose. |
| A shader domain changed or the consumer needs another domain | Check the shader selected by the material and the consuming component. Restore the intended compatible assignment. |
| Shader schema or material asset is unavailable | Follow the referenced AssetID to its source and current import error. Repair that dependency rather than replacing IDs arbitrarily. |
| A texture cannot be resolved | Locate its `.meta` and source, check the referenced subasset and its current import result. A retained reference is not a successful load. |
| Normal/emission/region semantics are incompatible | Assign a texture imported for that surface role and matching region semantics. Normal data must be linear and not premultiplied; emission must use the supported RGB or mask role. |

## Verify the fix

Save the corrected source or assignment, import the affected dependency if needed, and inspect the same consumer during Play. Check that the intended sprite, normal, emission or camera effect appears and that the full cause no longer occurs. Keep unrelated materials and AssetIDs unchanged. See [Materials and shaders](/render2d/materials.md) and [camera post-processing](/ref/render2d.PostProcess.md).

## PFX001

The camera cannot use the named Post Process stack with its current effects, parameters or output.

**Fix.** Follow the reason shown for the camera in the Inspector and correct the indicated setting, such as a Vignette intensity outside the range from 0 to 1.

## PFX002

Several active cameras have enabled Post Process components on the same logical output, so their stacks are bypassed.

**Fix.** Keep Post Process enabled on one camera per output, including cameras whose stacks are empty.

## PHY001

Circle and capsule colliders keep their round shape, so the node and its parents must scale X and Y by the same amount.

**Fix.** Scale the node uniformly and change Radius instead, or use a Box or Polygon collider for a stretched shape.

## Details

With a scale of (2, 1) the collider cannot follow the drawing and is not created.

## PHY002

A polygon has fewer than three points, more than eight, points on one line or a concave outline, or a shape has a zero or negative size.

**Fix.** Give a polygon three to eight points that form a convex outline, split a concave shape into several colliders, and keep sizes and radii above zero.

## Details

The collider is not created, and the error blocks Play.

## PHY003

The Rigid Body 2D has a value the physics world refuses: a mass override of zero on a dynamic body, negative damping, a layer outside 0..31, or a transform or velocity that is not a number.

**Fix.** Read the message for the field, then give a dynamic body a positive Mass or set Mass Mode to auto.

## Details

The node is drawn but does not take part in physics.

## PHY004

A Distance Joint 2D or Revolute Joint 2D connects the body on its node with the body on Target.

**Fix.** Put the joint on a node with a Rigid Body 2D and pick another node with a body in Target.

## Details

One of them is missing, or Target points at the joint's own body, so the joint is not created.

## PHY005

Physics 2D works on 2D nodes in a 2D hierarchy.

**Fix.** Move the body out of the 3D branch, or build that part of the scene in 2D.

## Details

A body inside a 3D node has no 2D world transform to simulate, so it is skipped.

## PHY006

Moving a node with a Rigid Body 2D under another parent while the game runs recreates the body at the same world position and velocity.

**Fix.** Reparent before Play, or move the body with a joint or a script instead of changing its parent.

## Details

Contacts start over, and joints on the body are rebuilt. This is a warning: the game keeps running.

It appears when the scene is edited during Play, for example by dragging the node in the Hierarchy, so no scene file shows it.

## PHY007

A script changed the position of a dynamic or kinematic body in `Update`, outside the fixed step.

**Fix.** Move bodies in `FixedUpdate`, with forces, impulses or a velocity, or with `MoveTo` on a kinematic body; set the position directly only to teleport on purpose.

## Details

The change is applied at the next physics step as a teleport: no velocity, no collisions on the way. The example script does this every frame.

## PRT001

A field in the emitter has a non-finite value, an invalid range or an unsupported setting.

**Fix.** Correct the named field and keep both Lifetime bounds positive and ordered.

## PRT002

A particle asset reference cannot be resolved or its material does not support unlit sprites.

**Fix.** Restore the referenced texture, or assign an unlit sprite-domain material.

## SHD009

The renderer rejected a prepared shader variant.

**Fix.** Find the named asset and correct the specific compile, layout or consumer error in the full cause before retrying that variant.

## Find the source and cause

The code identifies the failed candidate, not necessarily a syntax error in the source. Read the full cause: it may be a driver compile log, an incompatible uniform layout, an old prepared shader or a nested [MAT004](/diagnostics.html#MAT004.md) material/domain mismatch.

1. Select the Console message and read its details. Keep the `code`, `asset`, `file`, `line`, graphics backend and complete `err` text together. A line of `0` means no source line was identified; do not treat it as the first line of the shader.
2. Find that AssetID or source path in Assets. Inspect the material's shader reference and the component or Post Process effect that consumes it. A failed sprite preview does not prove that a postfx shader is invalid for camera post-processing.
3. If the nested cause says `MAT004: postfx shader cannot draw sprite geometry`, correct the consumer: use the postfx material in the camera's Custom effect, not on SpriteRenderer. Do not change `#pragma postfx` to a sprite domain merely to silence this message.
4. For a compiler or link error, follow the reported source file and mapped line. For a layout mismatch, compare the reported member, type and offset with the shader/material declaration. If the message explicitly identifies a legacy prepared shader, reimport that source with the matching engine version.

## Verify the fix

Run the same consumer and shader variant again on the affected backend. Verify the intended visual effect and that no new SHD009 is reported. Reimporting every asset is not a diagnosis and cannot fix a domain mismatch. If it persists, attach the material, shader and includes, the smallest scene, engine version, backend and driver log to the reproduction.
