{"record":{"id":"227fc649e9135eb2","repo":"discourse/discourse","slug":"typeerror-message","errorCode":null,"errorMessage":"${typeError.message}","messagePattern":"\\$\\{typeError\\.message\\}","errorType":"validation","errorClass":"BlockError","httpStatus":null,"severity":"error","filePath":"frontend/discourse/app/lib/blocks/-internals/validation/args.ts","lineNumber":1121,"sourceCode":"      );\n    }\n  }\n\n  for (const [argName, argDef] of Object.entries(schema)) {\n    const value = providedArgs[argName];\n\n    // 2. Check required args\n    if (argDef.required && value === undefined) {\n      throw new BlockError(`missing required ${pathPrefix}.${argName}.`, {\n        path: `${pathPrefix}.${argName}`,\n      });\n    }\n\n    // 3. Validate type if value is provided\n    if (value !== undefined) {\n      const typeError = validateArgValue(value, argDef, argName, options);\n      if (typeError) {\n        throw new BlockError(typeError.message, {\n          path: `${pathPrefix}.${typeError.path}`,\n        });\n      }\n    }\n  }\n}\n","sourceCodeStart":1103,"sourceCodeEnd":1128,"githubUrl":"https://github.com/discourse/discourse/blob/1b2d7253e854205d2c95c80b2c6a1cdd42e45059/frontend/discourse/app/lib/blocks/-internals/validation/args.ts#L1103-L1128","documentation":"Blocks schema validation: the argument's value was provided and its name is valid, but validateArgValue found a type/schema mismatch — the wrapped message is the underlying type error (wrong type, failed enum/pattern, or out-of-range value per the ArgSchema). The BlockError carries the sub-path from that validation.","triggerScenarios":"Thrown at frontend/discourse/app/lib/blocks/-internals/validation/args.ts:1121 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the inner message for the specific constraint, then coerce or change the value at the call site to the declared type.","If the declared type is wrong, update the ArgSchema in the @block decorator to match reality.","For enum/pattern constraints, use one of the declared values or fix the pattern."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1b2d7253e854205d2c95c80b2c6a1cdd42e45059","analyzedAt":"2026-08-26T03:11:08.302Z","contentChangedAt":"2026-08-26T03:11:08.302Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}