I get the same problem, even with Breeze 1.3.6. In IE8, exportMetadata causes "Unexpected call to method or property access" errors.
For me the problem is intermittent but still very reproducible. I can just reload my app and sometimes it works fine, sometimes I get the JavaScript error, and sometimes the IE tab crashes completely with an "Internet Explorer has stopped working" dialog.
The error is actually thrown from inside the native JSON.stringify function. A workaround is to remove the native JSON object and use json2.js instead:
<head>
<!--[if lt IE 9]>
<script>
// Remove IE8's native JSON object. It doesn't work with Breeze.
JSON = undefined;
</script>
<script src="json2.js"></script>
<![endif]-->
</head>
You can download the latest version of json2.js the Raw link on its GitHub page.
Also, if you're going to use json2.js, Breeze has a bug in its call to JSON.stringify (line 5494 of breeze.debug.js in v1.3.6). __config.stringifyPad
should be the third argument to stringify, not the second. You'll need to insert a second argument null
so that the pad becomes the third argument. I have submitted a pull request, so hopefully this is fixed in Breeze 1.3.7.
I'm not sure what Breeze is passing in to JSON.stringify to make the native implementation fall over. It would be nice to get to the bottom of it, but for now I'm using this workaround.