title: require.js - undefined modules passed as arguments to define callback
body: <p>I have the following require js setup for my app:</p>
  
  <p><strong>app.js</strong></p>
  
  <pre><code>require.config({
      paths: {
          jquery: '../thirdparty/jquery-1.9.1.min',
          moment: '../thirdparty/moment',
          spinningwheel: '../thirdparty/datepicker/spinningwheel',
          handlebars: '../thirdparty/handlebars',
          colorgenerator: '../usercolors',
          baseconfig: '../config'        },
      shim: {
          'baseconfig': [],
          'spinningwheel': {
              deps: [],
              exports: 'SpinningWheel'
          },
          'handlebars': {
              deps: [],
              exports: 'Handlebars'
          }
  
      }
  });
  
  
  require(['jquery', 'dom', 'helpers', 'actions', 'history', 'store'], function ($, dom, helpers, actions, hist, store) {
      //all good on the home front at this point
      //all modules loaded properly
      history.render();
  })
  </code></pre>
  
  <p><strong>history.js</strong></p>
  
  <pre><code>define(['renderview'], function (renderview) {
      //all good here, render view is loaded properly
      return {
          render: function () {
              renderview({...});
          }
      };
  })
  </code></pre>
  
  <p><strong>renderview.js</strong></p>
  
  <pre><code>define(['jquery', 'helpers', 'dom'], function ($, helpers, dom) {
      function renderView(view) {
          var template = helpers.getTemplate(); //ERROR: helpers is undefined!
      }
  
      return renderView;
  });
  </code></pre>
  
  <p><strong>helpers.js</strong></p>
  
  <pre><code>define(['jquery', 'handlebars', 'history', 'dom', 'colorgenerator'], function ($, Handlebars, history, dom, ColorGenerator) {
      var helpers = {};
  
      helpers.getTemplate = function () {
         //do stuff
      };
  
      return helpers;
  });
  </code></pre>
  
  <p>So, as you can see, helpers is loaded just fine in the inital app.js callback, but when I get into renderview.js it is undefined.  The dependency arrays in the example are exactly what I have in my actual code, however I've redacted all <em>seemingly</em> irrelevant code.  Any ideas why helpers would be loaded fine in app.js but not in renderview.js?  Is this a circular dependency?  Doesn't look like it to me, but I may have been at this too long today :)</p>
  
  <p>Thanks for any help or suggestions!</p>
  
  <p><strong>Adding current solution, although I don't know why I need to do it this way :)</strong></p>
  
  <pre><code>define(['require', 'jquery', 'dom'], function (require, $, dom) {
      function renderView() {
          //responsible for rendering our view
          var helpers = require('helpers');
          var history = require('history');
  
          var v = history.get();
          ...
          tmpl = helpers.getTemplate(v.template);
          ...
      }
  
      return renderView;
  });
  </code></pre>
  
  <p>So, I could not get these modules to load properly without doing the require <em>inside</em> the callback, rather than specifying them as a dependency.  Would love some insight to why that is...</p>