Question

I am hitting an error on machines running IE8 in the proto.exportMetadata function. "Error: Unexpected call to method or property access". I am running version 1.2.1 currently when hitting this error. I will try to give more info if it is needed. Thanks.

Edit I updated to version to 1.3.5 and am running into a new issue with Data Execution Prevention (DEP) settings on my machine running IE8. The machine is set up with Windows XP Pro Service Pack 3 and running IE8. This is unfortunately not occurring when running IE10 with IE8 browser modes, this is occurring on a machine running IE8.

Was it helpful?

Solution

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.

OTHER TIPS

Edit: A number of IE8 specific issues were fixed in Breeze 1.3.6. You might want to try this as well.


If you are using IE8 you will need to use a ES5 shim like this: ES5 Shim. There is further documentation on this topic here: Breeze prerequisites

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top