title: ACE editor + requirejs + AMD jquery plugin: mode cannot be loaded
body: <p>I am using this version of ACE - git://github.com/ajaxorg/ace.git</p>
  
  <p>And the this is I load it via requirejs,</p>
  
  <pre><code>require([
      // Load our app module and pass it to our definition function
      'jquery',
      'ext/ace-master/lib/ace/ace'
  ...
  </code></pre>
  
  <p>And how I evoke the editor,</p>
  
  <pre><code>var editor = ace.edit("ace-editor");
  editor.setTheme("ext/ace-master/lib/ace/theme/eclipse");
  editor.getSession().setMode("ext/ace-master/lib/ace/mode/xml");
  </code></pre>
  
  <p>But I always get this error message, and syntax highlighter is not highlighting any code in the form,</p>
  
  <blockquote>
  <pre><code>Could not load worker
  ace.js (line 1)
  TypeError: this.$mode.createWorker is not a function
  
  
  ...ts","module","ace/lib/lang"],function(a,b,c){var d=a("../lib/lang"),e=function()...
  
  
  TypeError: a.getTokenizer is not a function
  
  
  ...ts","module","ace/lib/lang"],function(a,b,c){var d=a("../lib/lang"),e=function()...
  </code></pre>
  </blockquote>
  
  <p>Did anyone come across this problem and know how to fix it?</p>
  
  <p>If I use this build version - <a href="https://github.com/ajaxorg/ace-builds/" rel="nofollow">https://github.com/ajaxorg/ace-builds/</a> there are even more errors - files not found, etc.</p>
  
  <p>or this <a href="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" rel="nofollow">http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js</a> - lots of not-found errors!</p>
  
  <p>Note: I <strong>load the form</strong> via <strong>jquery ajax</strong>  by the way, is it the ajax that causing the error??</p>