title: RequireJS with jQuery and Module - Uncaught ReferenceError: Module is not defined
body: <p>Here I have a simple requirejs setup. It consists of two dependencies - one being jQuery and another being my own module. I am recieving an error on myModule.init(): </p>
  
  <pre><code>Uncaught ReferenceError: myModule is not defined
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code>&lt;script data-main="js/app.js" src="js/require.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>Code in app.js:</p>
  
  <pre><code>requirejs.config({
      baseUrl: 'js/lib',
      paths: {
          app: '../app',
          jquery: 'jquery-3.1.1.min',
      }
  });
  
  
  // Start the main app logic.
  requirejs(['jquery', 'app/myModule'],
      function($, myModule) {
          myModule.init();
      });
  </code></pre>
  
  <p>Here is the Module that I created:</p>
  
  <pre><code>define('myModule', function () {
      return {
              init: function(){
                  console.log('Hello World!');
              }
          }
  });
  </code></pre>
  
  <p>Console Log:</p>
  
  <pre><code>Uncaught TypeError: Cannot read property 'init' of undefined
  </code></pre>
  
  <p><a href="http://requirejs.org/docs/jquery.html" rel="nofollow noreferrer">RequireJS Style Guide</a></p>