{"record":{"id":"689bcea8aedca85f","repo":"pentaho/pentaho-kettle","slug":"must-be-or-identify-a-type-module","errorCode":null,"errorMessage":"Must be or identify a type module.","messagePattern":"Must be or identify a type module\\.","errorType":"validation","errorClass":"ArgumentInvalidError","httpStatus":null,"severity":"error","filePath":"plugins/core-ui/src/main/resources/app/pentaho/_core/module/TypeMeta.js","lineNumber":135,"sourceCode":"          this.__instances = instances = [];\n        }\n\n        instances.push(instance);\n      },\n      // endregion\n\n      /** @inheritDoc  */\n      isSubtypeOf: function(baseIdOrAlias) {\n        if(!baseIdOrAlias) {\n          throw new ArgumentRequiredError(\"baseIdOrAlias\");\n        }\n\n        var baseModule = typeof baseIdOrAlias === \"string\"\n          ? core.moduleMetaService.get(baseIdOrAlias, keyArgsAssertDefined)\n          : baseIdOrAlias;\n\n        if(!(baseModule instanceof TypeMeta)) {\n          throw new ArgumentInvalidError(\"baseIdOrAlias\", \"Must be or identify a type module.\");\n        }\n\n        var subModule = this;\n        do {\n          if(baseModule === subModule) {\n            return true;\n          }\n\n          subModule = subModule.ancestor;\n        } while(subModule !== null);\n\n        return false;\n      },\n\n      /** @override */\n      _prepareCoreAsync: function() {\n\n        if(this.ancestor !== null) {","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/core-ui/src/main/resources/app/pentaho/_core/module/TypeMeta.js#L117-L153","documentation":"TypeMeta.isSubtypeOf accepts either a TypeMeta instance or a string module id/alias. ArgumentInvalidError is thrown when the provided value is neither: the string id did not resolve (moduleMetaService.get with assert would throw earlier, so here the value is a non-TypeMeta object, number, boolean, etc.).","triggerScenarios":"Calling isSubtypeOf with a non-string object that is not a TypeMeta instance (e.g. a plain object, a module descriptor object, or a wrong class instance).","commonSituations":"Passing a raw module config object instead of resolving it to its metadata; passing the result of another API that returns something other than TypeMeta; API/version changes where the service returns plain objects.","solutions":["Pass a string module id/alias instead of an object, so the service resolves it","Resolve the module first via core.moduleMetaService.get(id) and pass the returned TypeMeta","Check the value type before calling: instanceof TypeMeta or typeof === 'string'"],"exampleFix":"// before\nvar isSub = someType.isSubtypeOf({id: 'pentaho/type/string'});\n// after\nvar isSub = someType.isSubtypeOf('pentaho/type/string');","handlingStrategy":"type-guard","validationCode":"if (!(typeof baseId === 'string' || baseId instanceof TypeMeta)) throw new Error('baseIdOrAlias must be a string id or TypeMeta');","typeGuard":"function isTypeMetaLike(v) { return typeof v === 'string' || (v && v instanceof TypeMeta); }","tryCatchPattern":"try { return type.isSubtypeOf(baseIdOrAlias); } catch (e) { if (e instanceof ArgumentInvalidError) { console.warn('Invalid base type argument', baseIdOrAlias); return false; } throw e; }","preventionTips":["Prefer string module ids over passing objects to isSubtypeOf","When holding module references, obtain them from moduleMetaService.get so they are real TypeMeta instances","Recheck argument expectations after upgrading pentaho modules, as returned object types may change"],"tags":["argument-validation","type-mismatch","type-system"],"backgroundTag":"invalid-argument-value","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}