{"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":null,"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/294cab2f9b2e03af6b953820c7ab497c3c8b7ad9/src/Components/Web.JS/src/Services/ComponentDescriptorDiscovery.ts#L240-L276","documentation":"Thrown by validateServerComponentPayload (ComponentDescriptorDiscovery.ts:258) when a server/auto marker's payload has 'sequence' === undefined. The sequence orders component markers so the server reconciles them deterministically; a missing sequence means the marker JSON is incomplete.","triggerScenarios":"A server/auto marker JSON that omits the 'sequence' field; generated by a serializer configured to omit undefined values, or a truncated/rewritten marker.","commonSituations":"JSON.stringify with a replacer that drops numeric fields; version mismatch; a custom marker emitter that forgot sequence; middleware rewriting JSON.","solutions":["Verify the served marker JSON includes an integer 'sequence'.","Match server and client framework versions.","Do not customize component marker generation; use IComponentRenderMode + the framework renderer.","Remove any JSON-transforming middleware on Blazor HTML responses."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"function hasSequence(payload: any): boolean {\n  return payload && payload.sequence !== undefined && payload.sequence !== null;\n}","typeGuard":"function isServerMarkerData(payload: any): payload is { descriptor: string; sequence: number } {\n  return typeof payload?.descriptor === 'string'\n    && payload.sequence !== undefined\n    && Number.isInteger(payload.sequence);\n}","tryCatchPattern":null,"preventionTips":["Avoid JSON.stringify replacers that omit numeric fields.","Pin framework versions.","Inspect served marker JSON when debugging."],"tags":["blazor","server-components","markers","serialization","validation"],"analyzedSha":"294cab2f9b2e03af6b953820c7ab497c3c8b7ad9","analyzedAt":"2026-08-06T20:08:02.189Z","schemaVersion":2},"datasetVersion":"2026-08-06T23:17:07.152Z"}