title: RequireJS Mismatched anonymous define error caused by Drupal?
body: <p>I've had a require.js app running on my drupal site for a few months now. To my knowledge, nothing has changed in the app's code, but suddenly yesterday I started getting the following error:</p>
  
  <pre><code>Uncaught Error: Mismatched anonymous define() module:
  </code></pre>
  
  <p>Interestingly, I got this same error even when my main.js file only included the following:</p>
  
  <pre><code>require.config({});
  require([''], function() {
  });
  </code></pre>
  
  <p>But, when I left main.js completely empty, I got the following error:</p>
  
  <pre><code>Uncaught Error: Script error for: piwik
  </code></pre>
  
  <p>Piwik is the first js file included at the head of the document.</p>
  
  <p>I checked the Require.js documentation and found that this can be caused by loading require modules outside of the Require.js API. To test if this was the case I ran my app outside of the Drupal environment -- instead of loading the  in a Drupal template I am now loading it through an external html file with the same markup as the Drupal template file. In that setup I don't receive the error and the app loads as expected.</p>
  
  <p>So my question then is, are there any known conflicts with Drupal core javascript files and require.js? The only thing I can imagine causing a problem is that jquery (which is included in the document head) does a check to see if define is a function and if it is defines jquery as a module... but jquery loads before I include the require.js script.</p>
  
  <p>I don't have any other scripts containing "define", "require" or "module" on the page.</p>
  
  <p>I'm using the most current version of Require (2.1.8) and the latest Drupal version (7.2.3)</p>