{"record":{"id":"3b37c349c4ff4bcb","repo":"dotnet/aspnetcore","slug":"assembly-must-be-defined-when-using-a-descriptor","errorCode":null,"errorMessage":"assembly must be defined when using a descriptor.","messagePattern":"assembly 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":270,"sourceCode":"\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\n  payload.parameterDefinitions = payload.parameterDefinitions && atob(payload.parameterDefinitions);\n  payload.parameterValues = payload.parameterValues && atob(payload.parameterValues);\n}\n\nfunction validateEndComponentPayload(json: string, prerenderId: string): void {\n  const payload = JSON.parse(json) as ComponentEndMarker;\n  if (Object.keys(payload).length !== 1) {\n    throw new Error(`Invalid end of component comment: '${json}'`);","sourceCodeStart":252,"sourceCodeEnd":288,"githubUrl":"https://github.com/dotnet/aspnetcore/blob/3600ca084e9c8b5f4174fc5e747f4c52d2100806/src/Components/Web.JS/src/Services/ComponentDescriptorDiscovery.ts#L252-L288","documentation":"Thrown by validateWebAssemblyComponentPayload when the assembly field is missing on a webassembly component marker. WebAssembly components need the assembly name to locate the component type at client load time. Without it the runtime cannot resolve which DLL contains the component.","triggerScenarios":"A <!--Blazor:{type:webassembly,...}--> comment with no 'assembly' key; the field stripped or renamed by an HTML transform.","commonSituations":"HTML minifier that drops fields; a custom marker emitter that omitted assembly; version mismatch where the marker schema changed; assembly name mismatch after a rename.","solutions":["Confirm the served comment JSON includes a non-empty 'assembly' field matching the DLL name.","Disable HTML transforms that alter Blazor comment JSON.","Emit markers only via the official prerendering/component-tag helper.","Keep server and client package versions aligned."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"function assertWasmAssembly(payload: any) {\n  if (!payload?.assembly) {\n    throw new Error('WebAssembly component marker is missing assembly.');\n  }\n}","typeGuard":"function hasAssembly(p: any): p is { assembly: string } {\n  return typeof p?.assembly === 'string' && p.assembly.length > 0;\n}","tryCatchPattern":null,"preventionTips":["Preserve the assembly field in marker JSON.","Use the official component-tag helper to emit markers.","Keep server and client versions aligned."],"tags":["blazor","prerendering","markers","webassembly","validation"],"backgroundTag":null,"analyzedSha":"3600ca084e9c8b5f4174fc5e747f4c52d2100806","analyzedAt":"2026-08-11T16:32:30.678Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}