0

I'm facing an issue when minifying breezejs :

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

This is happening when I try to call breeze.Validator, meaning breeze is undefined.

Now, I rely on ASP.NET MVC bundling mechanism for minifying the file breeze.debug.js along with all the other scripts in my application.

However, if instead of using breeze.debug.js I use breeze.min.js (the one provided by Breeze team), then it works fine.

What could be the reason for this problem ?

Sam
  • 13,934
  • 26
  • 108
  • 194
  • this is not solved yet, and I can reproduce it with the latest version of breeze. any idea what's wrong ? – Sam Jul 08 '13 at 15:21

1 Answers1

3

I've solved the problem by ignoring the breeze.debug.js file when in release mode and by ignoring the breeze.min.js file when in debug mode:

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"));
Sam
  • 13,934
  • 26
  • 108
  • 194