{"record":{"id":"db2e4fb45356212c","repo":"pentaho/pentaho-kettle","slug":"module-map-contains-an-empty-module-identifier","errorCode":null,"errorMessage":"Module map contains an empty module identifier.","messagePattern":"Module map contains an empty module identifier\\.","errorType":"validation","errorClass":"ArgumentInvalidError","httpStatus":null,"severity":"error","filePath":"plugins/core-ui/src/main/resources/app/pentaho/_core/module/MetaService.js","lineNumber":86,"sourceCode":"        var me = this;\n\n        var preparedModuleSpecMap = {};\n        var preparedModuleIdList = [];\n\n        O.eachOwn(moduleSpecMap, prepareModule, this);\n\n        preparedModuleIdList.forEach(function(id) {\n          moduleResolver(id);\n        });\n\n        return this;\n\n        // ---\n\n        // 1. Perform basic validation and index by id and alias.\n        function prepareModule(moduleSpec, id) {\n          if(!id) {\n            throw new ArgumentInvalidError(\n              \"moduleSpecMap\",\n              \"Module map contains an empty module identifier.\");\n          }\n\n          if(!moduleSpec) {\n            throw new ArgumentInvalidError(\n              \"moduleSpecMap\",\n              \"Module with id '\" + id + \"' provides no specification.\");\n          }\n\n          // ---\n\n          var module = this.__get(id);\n          if(module !== null) {\n            module.__configure(moduleSpec);\n          } else {\n\n            if(O.hasOwn(preparedModuleSpecMap, id)) {","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/core-ui/src/main/resources/app/pentaho/_core/module/MetaService.js#L68-L104","documentation":"pentaho.lang.ArgumentInvalidError thrown by prepareModule in MetaService while validating a moduleSpecMap: a key in the map is an empty (falsy) module identifier. Every module entry in the map must be indexed by a non-empty id.","triggerScenarios":"Calling __configure/metaService configuration with a map like {\"\": {...}} or {null: {...}}, typically from a computed key that evaluated to an empty string.","commonSituations":"Dynamically building the module map from config or variables where an id variable was empty; JSON config with an empty-string key; templated module definitions where substitution failed.","solutions":["Fix the key in the moduleSpecMap so every entry has a non-empty string id.","Log the incoming map before configuration to spot the empty key.","Skip or default empty ids at map construction time."],"exampleFix":"// before\nvar map = {}; map[getConfig(\"moduleId\")] = spec; // moduleId may be \"\"\n// after\nvar id = getConfig(\"moduleId\");\nif(id) map[id] = spec;","handlingStrategy":"validation","validationCode":"Object.keys(moduleSpecMap).forEach(function(k) {\n  if(!k) throw new Error(\"empty module id in moduleSpecMap\");\n});","typeGuard":"function hasValidIds(map) { return Object.keys(map).every(function(k) { return typeof k === \"string\" && k.length > 0; }); }","tryCatchPattern":"try { metaService.__configure(map); } catch(e) { if(/empty module identifier/.test(e.message)) { console.error(\"bad keys:\", Object.keys(map)); } else { throw e; } }","preventionTips":["Guard computed keys before adding them to the map","Validate the whole spec map before configuration"],"tags":["invalid-argument","module-configuration","empty-identifier"],"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"}