简体   繁体   English

Require.js Ace编辑器脚本错误

[英]Require.js ace editor script errors

I am doing the following: 我正在执行以下操作:

<script src="/js/lib/require.js" data-main="/js/app"></script>

app.js app.js

requirejs.config({
    "baseUrl": "/js/lib",
    "paths": {
        "app": "../app",
        "jquery": "//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min",
        "ace": "ace"
    }
});

// Load the main app module to start the app
requirejs(["app/main"]);

main.js main.js

define(["jquery", "ace/ace"], function($, ace){

    $(document).ready(function(){
        var editor = ace.edit("editor-ace");
        editor.getSession().setMode("ace/mode/html");
    });
});

It seems to work fine, I see the ace editor with syntax highlighting. 看来工作正常,我看到带有语法高亮显示的ace编辑器。

However when I look in the javascript error log I see lots of entries like this... 但是,当我查看javascript错误日志时,会看到很多类似这样的条目...

Script error for: ace/edit_session
Script error for: ace/undomanager

etc.. 等等..

Can someone please point out where I am going wrong (I am pretty new to require.js)? 有人可以指出我要去哪里了吗(require.js我很新)?

看来您使用的是打包版本,这是一个已知的错误https://github.com/ajaxorg/ace-builds/issues/35,原因是来自https://groups.google.com/d的定义调用顺序错误/ msg / ace-discuss / w6WlAmR0SH4 / 6tdtlMhnY40J似乎应该尽快修复。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM