{"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":"Error","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/3600ca084e9c8b5f4174fc5e747f4c52d2100806/src/Components/Web.JS/src/Services/ComponentDescriptorDiscovery.ts#L244-L280","documentation":"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.","triggerScenarios":"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.","commonSituations":"JSON re-serialization that turned the integer into a string; a CMS or template engine that coerces numbers; hand-crafted markers with quoted numbers.","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."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"function assertIntegerSequence(payload: any) {\n  if (!Number.isInteger(payload?.sequence)) {\n    throw new Error(`sequence must be an integer, got ${payload?.sequence}`);\n  }\n}","typeGuard":"function isIntegerSequence(p: any): p is { sequence: number } {\n  return Number.isInteger(p?.sequence);\n}","tryCatchPattern":null,"preventionTips":["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."],"tags":["blazor","prerendering","markers","server","validation","types"],"backgroundTag":null,"analyzedSha":"3600ca084e9c8b5f4174fc5e747f4c52d2100806","analyzedAt":"2026-08-11T16:32:30.678Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}