dotnet/aspnetcore · error · Error
Error parsing the sequence
Error message
Error parsing the sequence '${sequence}' for component '${JSON.stringify(payload)}' What it means
Thrown by validateServerComponentPayload when sequence is present but not an integer (Number.isInteger returns false). The sequence must be a whole number to represent deterministic render order; floats, NaN, strings, or other types are rejected. The message echoes both the bad value and the full payload JSON for diagnosis.
Solutions
- Ensure the sequence value is emitted as a JSON number (unquoted integer).
- Stop any post-processing that coerces marker JSON types.
- Regenerate markers from the official prerendering pipeline.
- Align server and client versions.
Defensive patterns
Strategy: type-guard
Validate before calling
function assertIntegerSequence(payload: any) {
if (!Number.isInteger(payload?.sequence)) {
throw new Error(`sequence must be an integer, got ${payload?.sequence}`);
}
} Type guard
function isIntegerSequence(p: any): p is { sequence: number } {
return Number.isInteger(p?.sequence);
} Prevention
- Emit sequence as a JSON number, not a string.
- Don't let serializers/coercers change marker field types.
- Validate marker payloads in CI HTML checks.
When it happens
Trigger: A server component marker where 'sequence' is a string like "1", a float, null (typeof null is object), or NaN; a transform that converted numbers to strings.
Common situations: JSON re-serialization that turned the integer into a string; a CMS or template engine that coerces numbers; hand-crafted markers with quoted numbers.
Related errors
- descriptor must be defined when using a descriptor.
- sequence must be defined when using a descriptor.
- assembly must be defined when using a descriptor.
- Invalid component type
- Invalid end of component comment
AI-assisted analysis of dotnet/aspnetcore@3600ca084e (2026-08-11).
Data as JSON: /api/errors/44c73b2e029cc7f9.
Report an issue: GitHub.
Appendix: source
Thrown at src/Components/Web.JS/src/Services/ComponentDescriptorDiscovery.ts:262
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.');
}
// Parameter definitions and values come Base64 encoded from the server, since they contain random data and can make the
// comment invalid. We could unencode them in .NET Code, but that would be slower to do and we can leverage the fact that
// JS provides a native function that will be much faster and that we are doing this work while we are fetching
// blazor.boot.jsonView on GitHub (pinned to 3600ca084e)