dotnet/aspnetcore · error · ArgumentException

Missing required parameter '{nameof(Value)}' for component '

Error message

Missing required parameter '{nameof(Value)}' for component '{GetType().Name}'.

What it means

Thrown by CascadingValue<TValue>.SetParametersAsync when the Value parameter was never supplied. Even though Value can be null (for reference types), some Value parameter must be explicitly passed — a CascadingValue with no Value serves no purpose. The check uses a hasSuppliedValue flag tracked at CascadingValue.cs:67-70,103-106.

Source

Thrown at src/Components/Components/src/CascadingValue.cs:105

            }
            else
            {
                throw new ArgumentException($"The component '{nameof(CascadingValue<TValue>)}' does not accept a parameter with the name '{parameter.Name}'.");
            }
        }

        if (_hasSetParametersPreviously && IsFixed != previousFixed)
        {
            throw new InvalidOperationException($"The value of {nameof(IsFixed)} cannot be changed dynamically.");
        }

        _hasSetParametersPreviously = true;

        // It's OK for the value to be null, but some "Value" param must be supplied
        // because it serves no useful purpose to have a <CascadingValue> otherwise.
        if (!hasSuppliedValue)
        {
            throw new ArgumentException($"Missing required parameter '{nameof(Value)}' for component '{GetType().Name}'.");
        }

        // Rendering is most efficient when things are queued from rootmost to leafmost.
        // Given a components A (parent) -> B (child), you want them to be queued in order
        // [A, B] because if you had [B, A], then the render for A might change B's params
        // making it render again, so you'd render [B, A, B], which is wasteful.
        // At some point we might consider making the render queue actually enforce this
        // ordering during insertion.
        //
        // For the CascadingValue component, this observation is why it's important to render
        // ourself before notifying subscribers (which can be grandchildren or deeper).
        // If we rerendered subscribers first, then our own subsequent render might cause an
        // further update that makes those nested subscribers get rendered twice.
        _renderHandle.Render(Render);

        if (_subscribers != null && ChangeDetection.MayHaveChanged(previousValue, Value))
        {
            NotifySubscribers(parameters.Lifetime);

View on GitHub (pinned to 294cab2f9b)

Solutions

  1. Always supply a Value parameter to <CascadingValue>, even if it is null.
  2. If you intended a value-less container, reconsider — CascadingValue requires a value by design.

Example fix

// before
<CascadingValue>
    <Consumer />
</CascadingValue>

// after
<CascadingValue Value="@_someValue">
    <Consumer />
</CascadingValue>
Defensive patterns

Strategy: validation

Validate before calling

if (!parameters.Any(p => p.Name.Equals("Value", StringComparison.OrdinalIgnoreCase)))
    throw new ArgumentException("CascadingValue requires a Value parameter.");

Prevention

When it happens

Trigger: Writing <CascadingValue> without a Value attribute, or <CascadingValue ChildContent>... but omitting Value.

Common situations: Copy-paste error where ChildContent is set but Value is dropped; refactoring that removes the Value binding accidentally.

Related errors


AI-assisted analysis of dotnet/aspnetcore@294cab2f9b (2026-08-06). Data as JSON: /api/errors/13668b9e75f00863. Report an issue: GitHub.