stride3d/stride · error · InvalidOperationException
Property path parse error: could not parse indexer value
Error message
Property path parse error: could not parse indexer value '{indexerName}' What it means
ListUpdateResolver.ResolveIndexer parses the indexer segment of a property path into an integer list index and throws InvalidOperationException when parsing fails. Same mechanism as the array resolver but for List<T> members; the path must address list elements numerically.
Solutions
- Ensure the indexer is a plain integer: 'Points[2]'.
- Validate/normalize the path before Compile (int.TryParse each bracketed segment).
- Check that the target member is actually a list and the intended syntax; for dictionaries use the dictionary resolver path instead.
- Handle the InvalidOperationException at Compile time and surface the offending path in your own error message.
Example fix
// before
var path = $"Points[{indexName}]"; // indexName = 'last'
// after
var path = $"Points[{indexInt}]"; // indexInt = 0 Defensive patterns
Strategy: validation
Validate before calling
bool isValidListPath(string path) { var m = System.Text.RegularExpressions.Regex.Match(path, @"\[([^\]]*)\]"); return m.Success && int.TryParse(m.Groups[1].Value, out _); } Try / catch
try { engine.Compile(target, path, ...); } catch (InvalidOperationException ex) when (ex.Message.Contains("indexer value")) { log.Error($"Invalid list indexer in path: {path}"); } Prevention
- Ensure list indexer segments are integers
- Normalize/trim paths before compilation
- Keep animation path generation and member types in sync
- Surface the offending path in your own error handling
When it happens
Trigger: Compiling a property path addressing a List<T> member with a non-integer indexer, e.g. 'Points[first]' or 'Points[]' via UpdateEngine.Compile / animation keys.
Common situations: Hand-written animation paths with symbolic indices; paths copied from dictionary-style bindings; generated paths where the index variable was empty or non-numeric at string-build time.
Understand the failure class
Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
Related errors
- Property path parse error: could not find cast operation…
- Property path parse error: could not find indexer end ']'
- Property path parse error: could not parse indexer value
- Could not resolve type
- Property path parse error: could not find binding info for…
AI-assisted analysis of stride3d/stride@96fad776d2 (2026-09-14).
Data as JSON: /api/errors/e445c1e9c313c9b0.
Report an issue: GitHub.
Appendix: source
Thrown at sources/engine/Stride.Engine/Updater/ListUpdateResolver.cs:23
using System.Globalization;
namespace Stride.Updater
{
/// <summary>
/// Resolver for <see cref="IList{T}"/> in property path.
/// </summary>
/// <typeparam name="T">The type of list items.</typeparam>
public class ListUpdateResolver<T> : UpdateMemberResolver
{
public override Type SupportedType => typeof(IList<T>);
/// <inheritdoc/>
public override UpdatableMember ResolveIndexer(string indexerName)
{
// Transform index into integer
int indexerValue;
if (!int.TryParse(indexerName, NumberStyles.Any, CultureInfo.InvariantCulture, out indexerValue))
throw new InvalidOperationException(string.Format("Property path parse error: could not parse indexer value '{0}'", indexerName));
return new UpdatableListAccessor<T>(indexerValue);
}
}
}
View on GitHub (pinned to 96fad776d2)