{"record":{"id":"d1de597e7b90674e","repo":"pentaho/pentaho-kettle","slug":"pentaho-messages-bundle-path-argument-cannot-be-a-single","errorCode":null,"errorMessage":"[pentaho/messages!] Bundle path argument cannot be a single '/'.","messagePattern":"\\[pentaho/messages!\\] Bundle path argument cannot be a single '/'\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"plugins/core-ui/src/main/resources/app/pentaho/i18n/serverService.js","lineNumber":77,"sourceCode":"  };\n\n  /**\n   * Normalizes the given bundle module identifier.\n   *\n   * @param {string} bundlePath - The specified bundle path argument.\n   * @return {string} The normalized bundle identifier.\n   */\n  function __getBundleId(bundlePath) {\n    var bundleMid;\n    if(!bundlePath) {\n      // E.g. bundlePath=\"pentaho/i18n!\"\n      // Use the default location and bundle.\n      bundleMid = \"./i18n/messages\";\n    } else if(bundlePath[0] === \"/\") {\n      // E.g. bundlePath=\"pentaho/i18n!/pentaho/common/nls/messages\"\n      // The path is, directly, an absolute module id of a message bundle (without the /).\n      bundleMid = bundlePath.substr(1);\n      if(!bundleMid) throw new Error(\"[pentaho/messages!] Bundle path argument cannot be a single '/'.\");\n    } else if(bundlePath[0] !== \".\" && bundlePath.indexOf(\"/\") < 0) {\n\n      // the name of a bundle in the default \"./i18n\" sub-module\n      bundleMid = \"./i18n/\" + bundlePath;\n    } else {\n      // \"pentaho/i18n!./nls/information\"\n      // The path is, directly, a relative module id of a message bundle\n      // Or the path has already been resolved by RequireJS.\n      bundleMid = bundlePath;\n    }\n\n    return bundleMid;\n  }\n\n  /**\n   * Gets a bundle info object with the plugin identifier and bundle name,\n   * for a given bundle module identifier.\n   *","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/core-ui/src/main/resources/app/pentaho/i18n/serverService.js#L59-L95","documentation":"The pentaho/messages loader plugin (server-side i18n) mirrors defaultService: in __getBundleId, a bundlePath starting with '/' is stripped and used as an absolute bundle module id; an empty remainder (a lone '/') produces an Error since no bundle id can be derived. It is raised while computing the bundleMid used by the plugin.","triggerScenarios":"Requiring 'pentaho/messages!/' or building the dependency string so only '/' follows the '!'; server-side code interpolating an empty bundle path variable.","commonSituations":"Configuration for a server message bundle missing its path so concatenation yields '/'; copy-paste from i18n! usage with the module part deleted.","solutions":["Supply a concrete bundle module id, e.g. pentaho/messages!/pentaho/common/messages","Trace the interpolation producing the empty path and fix the source value","Validate bundlePath non-empty before building the loader module id"],"exampleFix":"// before\nvar dep = 'pentaho/messages!/' + serverBundlePath; // serverBundlePath === ''\n// after\nif (!serverBundlePath) serverBundlePath = 'pentaho/common/messages';\nvar dep = 'pentaho/messages!/' + serverBundlePath;","handlingStrategy":"validation","validationCode":"var path = String(bundlePath || '');\nif (path === '/' || !path) throw new Error('pentaho/messages! requires a non-empty bundle path');","typeGuard":"function isUsableServerBundlePath(p) { return typeof p === 'string' && p.length > 0 && p !== '/'; }","tryCatchPattern":"try { var bundle = require('pentaho/messages!' + path); } catch (e) { if (e.message.indexOf('cannot be a single') >= 0) { bundle = require('pentaho/messages!./i18n/messages'); } else throw e; }","preventionTips":["Validate server bundle path configuration at startup","Guard interpolated values that form 'pentaho/messages!/' ids","Keep a fallback default bundle id for missing configurations"],"tags":["i18n","amd-loader","invalid-argument"],"backgroundTag":"invalid-argument-format","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"}