{"record":{"id":"44c73b2e029cc7f9","repo":"dotnet/aspnetcore","slug":"error-parsing-the-sequence-sequence-for-compo","errorCode":null,"errorMessage":"Error parsing the sequence '${sequence}' for component '${JSON.stringify(payload)}'","messagePattern":"Error parsing the sequence '(.+?)' for component '(.+?)'","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/Components/Web.JS/src/Services/ComponentDescriptorDiscovery.ts","lineNumber":262,"sourceCode":"    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\n  // Parameter definitions and values come Base64 encoded from the server, since they contain random data and can make the\n  // comment invalid. We could unencode them in .NET Code, but that would be slower to do and we can leverage the fact that\n  // JS provides a native function that will be much faster and that we are doing this work while we are fetching\n  // blazor.boot.json","sourceCodeStart":244,"sourceCodeEnd":280,"githubUrl":"https://github.com/dotnet/aspnetcore/blob/294cab2f9b2e03af6b953820c7ab497c3c8b7ad9/src/Components/Web.JS/src/Services/ComponentDescriptorDiscovery.ts#L244-L280","documentation":"Thrown by validateServerComponentPayload (ComponentDescriptorDiscovery.ts:262) when 'sequence' is present but not an integer (Number.isInteger fails — e.g. a float, a string, NaN, Infinity). The marker JSON and full payload are echoed for diagnosis.","triggerScenarios":"Marker with sequence: 1.5, sequence: \"1\" (string), or sequence: null after JSON.parse; typically a serialization bug producing a non-integer or wrong type.","commonSituations":"Custom marker emitter passing a float or string; JSON produced with a converter that changes number formatting; framework version mismatch where sequence type changed; tampered/corrupted marker.","solutions":["Ensure sequence is emitted as a JSON integer literal (no quotes, no fractional part).","Use the framework's marker generation rather than a custom serializer.","Align framework versions between server and client.","Inspect the echoed payload in the error to see the exact bad value and trace where it was produced."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"function isIntegerSequence(payload: any): boolean {\n  return payload && Number.isInteger(payload.sequence);\n}","typeGuard":"function hasValidSequence(payload: any): payload is { sequence: number } {\n  return Number.isInteger(payload?.sequence);\n}","tryCatchPattern":null,"preventionTips":["Emit sequence as a JSON integer literal.","Use the framework's marker emitter.","Validate payloads in middleware tests."],"tags":["blazor","server-components","markers","validation","type-coercion"],"analyzedSha":"294cab2f9b2e03af6b953820c7ab497c3c8b7ad9","analyzedAt":"2026-08-06T20:08:02.189Z","schemaVersion":2},"datasetVersion":"2026-08-06T23:17:07.152Z"}