{"record":{"id":"f76533284c595a51","repo":"pentaho/pentaho-kettle","slug":"expected-module-with-id-or-alias-idoralias-to-be-a-type","errorCode":null,"errorMessage":"Expected module with id or alias '{idOrAlias}' to be a type module.","messagePattern":"Expected module with id or alias '(.+?)' to be a type module\\.","errorType":"validation","errorClass":"ArgumentInvalidError","httpStatus":null,"severity":"error","filePath":"plugins/core-ui/src/main/resources/app/pentaho/_core/module/MetaService.js","lineNumber":332,"sourceCode":"    }\n\n    /**\n     * Gets a type module given its identifier or alias.\n     *\n     * @param {pentaho.module.IMetaService} metaService - The module metadata service.\n     * @param {nonEmptyString} idOrAlias - The identifier or alias of the module.\n     * @param {nonEmptyString} argName - The name of the argument.\n     *\n     * @return {pentaho.module.ITypeMeta} The desired type module.\n     *\n     * @throws {pentaho.lang.ArgumentInvalidError} When the module is defined but is not a type module.\n     */\n    function __getTypeModule(metaService, idOrAlias, argName) {\n\n      var module = metaService.get(idOrAlias);\n\n      if(module !== null && module.kind !== \"type\") {\n        throw new ArgumentInvalidError(\n          argName,\n          \"Expected module with id or alias '\" + idOrAlias + \"' to be a type module.\");\n      }\n\n      return module;\n    }\n\n    /**\n     * The module comparer function.\n     *\n     * Implements the global order of modules: ranking descending + index ascending.\n     *\n     * @param {pentaho.module.ITypeMeta} moduleA - The first module.\n     * @param {pentaho.module.ITypeMeta} moduleB - The second module.\n     *\n     * @return {number} The comparison result.\n     */\n    function __moduleComparer(moduleA, moduleB) {","sourceCodeStart":314,"sourceCodeEnd":350,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/core-ui/src/main/resources/app/pentaho/_core/module/MetaService.js#L314-L350","documentation":"pentaho.lang.ArgumentInvalidError thrown by __getTypeModule (used by MetaService.type) when the module resolved from the given id or alias exists but its kind is not \"type\". The type() API only accepts type modules; instance modules are rejected via the caller-supplied argument name.","triggerScenarios":"Calling metaService.type(idOrAlias) where the id/alias resolves to a registered module of another kind, such as an instance module.","commonSituations":"Passing an instance/implementation module id or its alias instead of the model/type id; alias collisions that map a name to a non-type module; API migration where an id that used to be a type became an instance module.","solutions":["Pass the id or alias of a type module to type().","Fix the alias so it points to the type module you intend.","If you need an instance module, use the appropriate API instead of type()."],"exampleFix":"// before\nvar Model = metaService.type(\"my/modelInstance\"); // instance module\n// after\nvar Model = metaService.type(\"pentaho/visual/models/bar\");","handlingStrategy":"validation","validationCode":"var m = metaService.get(idOrAlias);\nif(m && m.kind !== \"type\") throw new Error(\"'\" + idOrAlias + \"' is not a type module\");\nvar T = metaService.type(idOrAlias);","typeGuard":"function isTypeModuleId(id) { var m = metaService.get(id); return m !== null && m.kind === \"type\"; }","tryCatchPattern":"try { T = metaService.type(idOrAlias); } catch(e) { if(/to be a type module/.test(e.message)) { T = null; } else { throw e; } }","preventionTips":["Check module.kind === \"type\" before calling type()","Avoid aliases that shadow type ids with instance modules"],"tags":["kind-mismatch","type-module","invalid-argument"],"backgroundTag":"type-mismatch","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"}