title: Masonry.js failing on load. Cannot call 'create' of undefined (Outerlayer) in Wordpress
body: <p>So I've got a strange problem that I can't seem to find anywhere else, regarding masonry.js.</p>
  
  <p>I've got <a href="https://raw.github.com/desandro/masonry/v3.1.0/masonry.js">the latest (3.10) version</a> and I'm including it in my wordpress theme's functions.php file as so:</p>
  
  <pre><code>function enqueue ()
  {
      wp_register_script( 'masonry', get_stylesheet_directory_uri() . '/js/masonry.js', array( 'jquery' ) );
      wp_enqueue_script( 'masonry' );
  }
  
  add_action( 'wp_enqueue_scripts', 'enqueue');
  </code></pre>
  
  <p>Which is loading the script fine. As it is now, I'm not doing <em>anything</em> else with it, but the script is failing:</p>
  
  <pre><code>Uncaught TypeError: Cannot call method 'create' of undefined masonry.js?ver=3.5.2:37
  </code></pre>
  
  <p>Seems like it cannot call create on the window.Outerlayer as it doesnt exist.</p>
  
  <p>Here's the code in question, starting at line 34 from the masonry.js:</p>
  
  <pre><code>// used for AMD definition and requires
  function masonryDefinition( Outlayer, getSize ) {
    // create an Outlayer layout class
    var Masonry = Outlayer.create('masonry');
  
    Masonry.prototype._resetLayout = function() {
      this.getSize();
      this._getMeasurement( 'columnWidth', 'outerWidth' );
      this._getMeasurement( 'gutter', 'outerWidth' );
      this.measureColumns();
  
      // reset column Y
      var i = this.cols;
      this.colYs = [];
      while (i--) {
        this.colYs.push( 0 );
      }
  
      this.maxY = 0;
    };
  </code></pre>
  
  <p>I've tried enqueueing the script in different ways, as well as pulling it in only when $(document).ready() (which I believe wordpress' enqueue_script does anyway?).</p>
  
  <p>So, does anyone have any ideas what the problem or conflict could be here? Or has anyone experienced anything similar?</p>
  
  <p>(I'm using jQuery 1.83, though masonry shouldn't require jquery according to the site.)</p>