{"record":{"id":"b9bf958c2efb840a","repo":"pentaho/pentaho-kettle","slug":"pentaho-messages-bundle-path-argument-cannot-be-a-single-b9bf95","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.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.js#L59-L95","documentation":"__getBundleId maps a bundlePath argument to an AMD module id for the message bundle. A path starting with '/' is treated as an absolute module id with the slash stripped (e.g. '/pentaho/common/nls/messages' -> 'pentaho/common/nls/messages'). If the path is exactly '/', stripping it yields an empty module id, which is meaningless, so the code throws this specific error.","triggerScenarios":"Passing the literal string '/' as bundlePath to the i18n bundle-path resolution (bundleMid computation); any path that is a single forward slash.","commonSituations":"A variable holding a path defaulting to '/' or built by joining segments where both segments were empty; config value accidentally set to the filesystem-style root '/'; string slicing that removed all meaningful characters.","solutions":["Inspect where bundlePath originates and replace the '/' default with a real bundle name or './i18n/messages'.","Never pass a bare '/' — use './i18n/messages' for the default bundle or 'pentaho/i18n!<absModuleId>' form without the leading slash.","Validate before calling: reject inputs that are empty or consist only of slashes.","Fix configuration files where the bundle path was set to '/'."],"exampleFix":"// before\ngetBundle(\"/\"); // throws\n// after\nvar path = bundlePath === \"/\" ? \"./i18n/messages\" : bundlePath;\ngetBundle(path);","handlingStrategy":"validation","validationCode":"if (bundlePath == null || bundlePath.replace(/\\//g, \"\").length === 0) {\n  bundlePath = \"./i18n/messages\";\n}","typeGuard":"function isUsableBundlePath(v) {\n  return typeof v === \"string\" && v.length > 0 && v !== \"/\";\n}","tryCatchPattern":"try {\n  return resolveBundle(bundlePath);\n} catch (e) {\n  if (String(e.message).indexOf(\"cannot be a single\") !== -1) {\n    return resolveBundle(\"./i18n/messages\");\n  }\n  throw e;\n}","preventionTips":["Default missing bundle paths to './i18n/messages' rather than '/'.","Never join path segments such that the result can collapse to '/'.","Reject root-like strings ('/', '') at configuration load time.","Prefer the 'pentaho/i18n!<moduleId>' form without the leading slash."],"tags":["i18n","argument-validation","amd-loader"],"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"}