pentaho/pentaho-kettle · error · Error

[pentaho/messages!] Bundle path argument cannot be a single…

Error message

[pentaho/messages!] Bundle path argument cannot be a single '/'.

What it means

__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.

Solutions

  1. Inspect where bundlePath originates and replace the '/' default with a real bundle name or './i18n/messages'.
  2. Never pass a bare '/' — use './i18n/messages' for the default bundle or 'pentaho/i18n!<absModuleId>' form without the leading slash.
  3. Validate before calling: reject inputs that are empty or consist only of slashes.
  4. Fix configuration files where the bundle path was set to '/'.

Example fix

// before
getBundle("/"); // throws
// after
var path = bundlePath === "/" ? "./i18n/messages" : bundlePath;
getBundle(path);
Defensive patterns

Strategy: validation

Validate before calling

if (bundlePath == null || bundlePath.replace(/\//g, "").length === 0) {
  bundlePath = "./i18n/messages";
}

Type guard

function isUsableBundlePath(v) {
  return typeof v === "string" && v.length > 0 && v !== "/";
}

Try / catch

try {
  return resolveBundle(bundlePath);
} catch (e) {
  if (String(e.message).indexOf("cannot be a single") !== -1) {
    return resolveBundle("./i18n/messages");
  }
  throw e;
}

Prevention

When it happens

Trigger: Passing the literal string '/' as bundlePath to the i18n bundle-path resolution (bundleMid computation); any path that is a single forward slash.

Common situations: 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.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/b9bf958c2efb840a. Report an issue: GitHub.

Appendix: source

Thrown at plugins/core-ui/src/main/resources/app/pentaho/i18n.js:77

  };

  /**
   * Normalizes the given bundle module identifier.
   *
   * @param {string} bundlePath - The specified bundle path argument.
   * @return {string} The normalized bundle identifier.
   */
  function __getBundleId(bundlePath) {
    var bundleMid;
    if(!bundlePath) {
      // E.g. bundlePath="pentaho/i18n!"
      // Use the default location and bundle.
      bundleMid = "./i18n/messages";
    } else if(bundlePath[0] === "/") {
      // E.g. bundlePath="pentaho/i18n!/pentaho/common/nls/messages"
      // The path is, directly, an absolute module id of a message bundle (without the /).
      bundleMid = bundlePath.substr(1);
      if(!bundleMid) throw new Error("[pentaho/messages!] Bundle path argument cannot be a single '/'.");
    } else if(bundlePath[0] !== "." && bundlePath.indexOf("/") < 0) {

      // the name of a bundle in the default "./i18n" sub-module
      bundleMid = "./i18n/" + bundlePath;
    } else {
      // "pentaho/i18n!./nls/information"
      // The path is, directly, a relative module id of a message bundle
      // Or the path has already been resolved by RequireJS.
      bundleMid = bundlePath;
    }

    return bundleMid;
  }

  /**
   * Gets a bundle info object with the plugin identifier and bundle name,
   * for a given bundle module identifier.
   *

View on GitHub (pinned to f3058517a1)