【问题标题】:breezejs: error when minifying the script微风js:缩小脚本时出错
【发布时间】:2013-06-04 12:26:37
【问题描述】:

我在缩小微风时遇到了一个问题:

Error : Cannot get property « Validator » of a null reference  
(that's not the exact message but a translation of the original.)

当我尝试调用微风.Validator 时会发生这种情况,这意味着微风是未定义的。

现在,我依靠 ASP.NET MVC 捆绑机制来缩小文件微风.debug.js 以及我的应用程序中的所有其他脚本。

但是,如果我不使用微风.debug.js,而是使用微风.min.js(由微风团队提供的那个),那么它可以正常工作。

这个问题的原因可能是什么?

【问题讨论】:

  • 这个还没解决,我用最新版的微风可以重现。知道怎么了?

标签: asp.net-mvc-4 breeze bundling-and-minification


【解决方案1】:

我已经通过在发布模式下忽略微风.debug.js 文件和在调试模式下忽略微风.min.js 文件解决了这个问题:

bundles.IgnoreList.Ignore("*.debug.js", OptimizationMode.WhenEnabled);
        bundles.IgnoreList.Ignore("*.min.js", OptimizationMode.WhenDisabled);

        bundles.Add(new ScriptBundle("~/bundles/breeze").Include("~/scripts/libs/breeze/breeze.debug.js")
            .Include("~/scripts/libs/breeze/breeze.min.js"));

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多