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
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.
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
Example fix
// before var dep = 'pentaho/messages!/' + serverBundlePath; // serverBundlePath === '' // after if (!serverBundlePath) serverBundlePath = 'pentaho/common/messages'; var dep = 'pentaho/messages!/' + serverBundlePath;
Defensive patterns
Strategy: validation
Validate before calling
var path = String(bundlePath || '');
if (path === '/' || !path) throw new Error('pentaho/messages! requires a non-empty bundle path'); Type guard
function isUsableServerBundlePath(p) { return typeof p === 'string' && p.length > 0 && p !== '/'; } Try / catch
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; } Prevention
- Validate server bundle path configuration at startup
- Guard interpolated values that form 'pentaho/messages!/' ids
- Keep a fallback default bundle id for missing configurations
When it happens
Trigger: Requiring 'pentaho/messages!/' or building the dependency string so only '/' follows the '!'; server-side code interpolating an empty bundle path variable.
Common situations: Configuration for a server message bundle missing its path so concatenation yields '/'; copy-paste from i18n! usage with the module part deleted.
Understand the failure class
Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.
Related errors
- [pentaho/i18n!] Bundle path argument cannot be a single '/'.
- [pentaho/messages!] Bundle path argument cannot be a single…
- [pentaho/messages!] Bundle path argument is invalid
- A module with id ' ' is not defined.
- ERROR_INVALID_ARGUMENT
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/d1de597e7b90674e.
Report an issue: GitHub.
Appendix: source
Thrown at plugins/core-ui/src/main/resources/app/pentaho/i18n/serverService.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)