diff --git a/lib/sear.js b/lib/sear.js
index <HASH>..<HASH> 100644
--- a/lib/sear.js
+++ b/lib/sear.js
@@ -203,7 +203,7 @@ SearModule.prototype._optimizeAMDHeaders = function (toplevel, options) {
       if (node.args[1] && node.args[1].elements) {
 
 
-        var cbArgs = [];
+        var cbArgs;
         if (node.args[2] instanceof UglifyJS.AST_Function) {
           cbArgs = _.pluck(node.args[2].argnames, 'name');
         }
@@ -212,7 +212,12 @@ SearModule.prototype._optimizeAMDHeaders = function (toplevel, options) {
           var value = item.value;
           if (commonjsModules.indexOf(value) === -1) {
             defineMap[value] = item.value = defineMap[value] || "m" + (++self.sear._amdHeaderId);
-            return cbArgs[indx];
+            if (!cbArgs) {
+              // Keep all deps if callback args could not be defined. Callback is a variable or other.
+              return true;
+            } else {
+              return cbArgs[indx];
+            }
           } else {
             return true;
           }
Fix vendor amd defines if define callback is defined as a variable