{"record":{"id":"ccd42c1fa8eeff4c","repo":"pentaho/pentaho-kettle","slug":"argument-deps-is-required","errorCode":null,"errorMessage":"Argument 'deps' is required.","messagePattern":"Argument 'deps' is required\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"plugins/core-ui/src/main/resources/app/pentaho/util/requireJS.js","lineNumber":93,"sourceCode":"     * When `deps` is an `Array`, zero or more modules are required,\n     * and the promise is fulfilled with an array with the values of those modules.\n     *\n     * Optionally, receives a contextual `require` function,\n     * so that module ids are taken relative to its module's folder.\n     *\n     * @param {string|Array.<string>} deps A single module id or an array of module ids.\n     * @param {?function} [relativeRequire] A contextual require function.\n     * Defaults to the global `require` function of the current Require JS context.\n     *\n     * @return {Promise|Promise.<Array>} A promise that\n     * is fulfilled with the value of the requested module(s), and\n     * is rejected in case a module loader error occurs (like an undefined module or timeout).\n     */\n    promise: function(deps, relativeRequire) {\n      if(deps == null) {\n        // Cannot use ArgumentRequiredError, or a cycle would occur, as it is based in Base.js and\n        // the latter uses this.\n        throw new Error(\"Argument 'deps' is required.\");\n      }\n\n      var requireFun = relativeRequire || context.require;\n\n      if(Array.isArray(deps)) {\n        return new Promise(function(resolve, reject) {\n          requireFun(deps, function() {\n            resolve(A_slice.call(arguments));\n          }, reject);\n        });\n      }\n\n      return new Promise(function(resolve, reject) {\n        requireFun([deps], resolve, reject);\n      });\n    },\n\n    /**","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/core-ui/src/main/resources/app/pentaho/util/requireJS.js#L75-L111","documentation":"The `promise` helper of the requireJS shim loads a set of AMD modules and returns a promise rejecting on loader errors (undefined module, timeout). It requires the dependency list as its first argument; ArgumentRequiredError is avoided to prevent a circular dependency with Base.js.","triggerScenarios":"Calling `pentaho/util/requireJS.promise()` with no arguments or with `null`/`undefined` as the deps argument.","commonSituations":"Building the deps array conditionally and passing undefined; refactoring call sites and dropping the first argument; dynamic module loading code with an uninitialized array variable.","solutions":["Pass an array of module ids as the first argument to promise()","Ensure the variable holding the deps list is initialized (default to []) before the call","Add an early guard in the calling code throwing a clearer, contextual error"],"exampleFix":"// before\nrequireJS.promise();\n// after\nrequireJS.promise(['pentaho/util/Base']);","handlingStrategy":"validation","validationCode":"if (!Array.isArray(deps)) throw new TypeError(\"promise() requires an array of module ids\");","typeGuard":"function isDepsArray(deps) { return Array.isArray(deps); }","tryCatchPattern":"try { await requireJS.promise(deps); } catch (e) { /* module loader error: log deps used */ }","preventionTips":["Default dynamic deps to an empty array before calling promise()","Never build deps arrays with possibly-undefined spread sources"],"tags":["javascript","amd","module-loader"],"backgroundTag":"missing-required-argument","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"}