{"record":{"id":"4947a272146c3770","repo":"dotnet/aspnetcore","slug":"sequence-must-be-defined-when-using-a-descriptor","errorCode":null,"errorMessage":"sequence must be defined when using a descriptor.","messagePattern":"sequence must be defined when using a descriptor\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/Components/Web.JS/src/Services/ComponentDescriptorDiscovery.ts","lineNumber":258,"sourceCode":"  validateWebAssemblyComponentPayload(payload);\n\n  return {\n    ...payload,\n    uniqueId: nextUniqueDescriptorId++,\n    start,\n    end,\n  };\n}\n\nfunction validateServerComponentPayload(payload: ServerMarkerData) {\n  const { descriptor, sequence } = payload;\n\n  if (!descriptor) {\n    throw new Error('descriptor must be defined when using a descriptor.');\n  }\n\n  if (sequence === undefined) {\n    throw new Error('sequence must be defined when using a descriptor.');\n  }\n\n  if (!Number.isInteger(sequence)) {\n    throw new Error(`Error parsing the sequence '${sequence}' for component '${JSON.stringify(payload)}'`);\n  }\n}\n\nfunction validateWebAssemblyComponentPayload(payload: WebAssemblyMarkerData) {\n  const { assembly, typeName } = payload;\n\n  if (!assembly) {\n    throw new Error('assembly must be defined when using a descriptor.');\n  }\n\n  if (!typeName) {\n    throw new Error('typeName must be defined when using a descriptor.');\n  }\n","sourceCodeStart":240,"sourceCodeEnd":276,"githubUrl":"https://github.com/dotnet/aspnetcore/blob/3600ca084e9c8b5f4174fc5e747f4c52d2100806/src/Components/Web.JS/src/Services/ComponentDescriptorDiscovery.ts#L240-L276","documentation":"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.","triggerScenarios":"A server component comment JSON object that has a descriptor but no 'sequence' key; sequence stripped by a transform.","commonSituations":"HTML post-processing that strips numeric fields; a custom serializer; partial corruption of the marker; version mismatch producing a marker schema without sequence.","solutions":["Confirm the served comment JSON includes an integer 'sequence' field.","Disable HTML transforms that modify Blazor comment payloads.","Ensure markers come from the official prerendering pipeline.","Match server and client Blazor runtime versions."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"function assertServerSequence(payload: any) {\n  if (payload?.sequence === undefined) {\n    throw new Error('Server component marker is missing sequence.');\n  }\n}","typeGuard":"function hasSequence(p: any): p is { sequence: number } {\n  return typeof p?.sequence === 'number';\n}","tryCatchPattern":null,"preventionTips":["Preserve the sequence field in any HTML transform.","Emit markers via the official pipeline only.","Match server and client runtime versions."],"tags":["blazor","prerendering","markers","server","validation"],"backgroundTag":null,"analyzedSha":"3600ca084e9c8b5f4174fc5e747f4c52d2100806","analyzedAt":"2026-08-11T16:32:30.678Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}