2013-06-04 38 views
0

時錯誤涅槃breezejs當我面對一個問題:breezejs:涅槃腳本

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

當我嘗試調用breeze.Validator這是發生,這意味着風是不確定的。

現在,我依靠ASP.NET MVC捆綁機制來縮小文件breeze.debug.js以及我的應用程序中的所有其他腳本。

但是,如果不是使用breeze.debug.js,而是使用breeze.min.js(Breeze團隊提供的那個),那麼它工作正常。

這個問題的原因是什麼?

+0

這個尚未解決,我可以用最新版本的微風重現它。任何想法有什麼不對? – Sam

回答

3

我忽略在釋放模式時breeze.debug.js文件,並通過忽略在調試模式下,當breeze.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"));