0

I use requirejs (2.1.14) and ace.js with this config:

require.config({
    baseUrl: 'myPath',
    paths: {
        ...
        ace: 'vendor/ace/lib/ace/ace',
        ...
    }
});

require([
'jquery','domReady','allbootstrap','ace'
], function($, domReady) {
    domReady(function () {
        var editor = ace.edit("editor");
        ...
    })
);

The ace.js (in bundles/myapps/vendor/ace/lib/ace/ace.js) is well called. But the ace.js start with:

define(function(require, exports, module) {
"use strict";
require("./lib/fixoldbrowsers");
var dom = require("./lib/dom");
...

But require doesn't find fixoldbrowsers.js. It looks in:

bundles/myapps/lib/fixoldbrowsers.js

But my file is in:

bundles/myapps/vendor/ace/lib/ace/lib/fixoldbrowsers.js

vittore
  • 17,449
  • 6
  • 44
  • 82
Harold
  • 669
  • 1
  • 7
  • 31
  • I see nothing amiss in what you are showing. What version of RequireJS are you using? Also, how do you load Ace? (Please add to your question the code with the `require` or `define` call that lists Ace as a dependency.) – Louis Sep 04 '14 at 12:31

1 Answers1

2

Thanks to nightwing (https://github.com/ajaxorg/ace/issues/1690

require.config({
  baseUrl: 'myPath',
  paths: {
    ...
    ace: 'vendor/ace/lib/ace',
    ...
  }
});
require(['jquery','domReady','ace/ace','allbootstrap'], 
  function($, domReady, ace) {
    domReady(function () {
      var editor = ace.edit("editor");
      ...
    })
);
Harold
  • 669
  • 1
  • 7
  • 31
  • Harold- I think I am stuck with something similar - would you be able to take a look at https://stackoverflow.com/questions/60177855/theme-and-mode-path-infer-issue-with-ace-js-and-angular – Manu Chadha Feb 12 '20 at 06:54