dotnet/aspnetcore · error · Error

sequence must be defined when using a descriptor.

Error message

sequence must be defined when using a descriptor.

What it means

Thrown by validateServerComponentPayload when the sequence field is undefined on a server component marker. The sequence number records the order in which components were added during prerendering and is required for correct hydration. Missing it indicates an incomplete or malformed marker payload.

Solutions

  1. Confirm the served comment JSON includes an integer 'sequence' field.
  2. Disable HTML transforms that modify Blazor comment payloads.
  3. Ensure markers come from the official prerendering pipeline.
  4. Match server and client Blazor runtime versions.
Defensive patterns

Strategy: validation

Validate before calling

function assertServerSequence(payload: any) {
  if (payload?.sequence === undefined) {
    throw new Error('Server component marker is missing sequence.');
  }
}

Type guard

function hasSequence(p: any): p is { sequence: number } {
  return typeof p?.sequence === 'number';
}

Prevention

When it happens

Trigger: A server component comment JSON object that has a descriptor but no 'sequence' key; sequence stripped by a transform.

Common situations: HTML post-processing that strips numeric fields; a custom serializer; partial corruption of the marker; version mismatch producing a marker schema without sequence.

Related errors


AI-assisted analysis of dotnet/aspnetcore@3600ca084e (2026-08-11). Data as JSON: /api/errors/4947a272146c3770. Report an issue: GitHub.

Appendix: source

Thrown at src/Components/Web.JS/src/Services/ComponentDescriptorDiscovery.ts:258

  validateWebAssemblyComponentPayload(payload);

  return {
    ...payload,
    uniqueId: nextUniqueDescriptorId++,
    start,
    end,
  };
}

function validateServerComponentPayload(payload: ServerMarkerData) {
  const { descriptor, sequence } = payload;

  if (!descriptor) {
    throw new Error('descriptor must be defined when using a descriptor.');
  }

  if (sequence === undefined) {
    throw new Error('sequence must be defined when using a descriptor.');
  }

  if (!Number.isInteger(sequence)) {
    throw new Error(`Error parsing the sequence '${sequence}' for component '${JSON.stringify(payload)}'`);
  }
}

function validateWebAssemblyComponentPayload(payload: WebAssemblyMarkerData) {
  const { assembly, typeName } = payload;

  if (!assembly) {
    throw new Error('assembly must be defined when using a descriptor.');
  }

  if (!typeName) {
    throw new Error('typeName must be defined when using a descriptor.');
  }

View on GitHub (pinned to 3600ca084e)