I am creating an MVC5 with Angular JS project (angular version v1.4.4) in VS2013. I was coding along and everything was fine and then suddenly I started getting this error on launch:
JavaScript critical error at line 5395, column 34 in http://localhost:63937/Scripts/angular.js\n\nSCRIPT1010: Expected identifier
I only get this error on IE10, it works fine on Chrome.
My references are in a layout file and look like this:
<link href="~/Content/bootstrap.css" rel="stylesheet" />
<link href="~/Content/Site.css" rel="stylesheet" />
<script src="~/Scripts/jquery-1.10.2.js"></script>
<script src="~/Scripts/angular.js"></script>
<script src="~/Scripts/bootstrap.js"></script>
<script src="~/Scripts/angular-route.js"></script>
The HTML page contains the reference to the App.js file. I could post some code, but it doesn't even seem to be hitting the App.JS file. Anyone ran into this issue or have any suggestions as to where I should start looking for the issue? As far as I know, I reverted my code back to the point where it was working in IE10 but it still wont run.
Here is the specific function in the angular.js file that contains the line number from the error. The specific line is in return statement in the 'catch' function:
getPromise: function() {
if (!this.defer) {
this.defer = $q.defer();
}
return this.defer.promise;
},
then: function(f1,f2) {
return this.getPromise().then(f1,f2);
},
'catch': function(f1) {
return this.getPromise().catch(f1);
},
'finally': function(f1) {
return this.getPromise().finally(f1);
}
Any help would greatly be appreciated.
It looks like this was recently introduced specifically in v1.4.4
according to the changelog:
$animateCss: make sure that skipBlocking avoids the pre-emptive transition-delay styling
To expand a bit more the line that's throwing the error for some context:
var $CoreAnimateCssProvider = function() {
this.$get = ['$$rAF', '$q', function($$rAF, $q) {
var RAFPromise = function() {};
RAFPromise.prototype = {
done: function(cancel) {
this.defer && this.defer[cancel === true ? 'reject' : 'resolve']();
},
end: function() {
this.done();
},
cancel: function() {
this.done(true);
},
getPromise: function() {
if (!this.defer) {
this.defer = $q.defer();
}
return this.defer.promise;
},
then: function(f1,f2) {
return this.getPromise().then(f1,f2);
},
'catch': function(f1) {
return this.getPromise().catch(f1);
},
'finally': function(f1) {
return this.getPromise().finally(f1);
}
};
//... more code
This $CoreAnimateCssProvider
wasn't included in 1.4.3
so it's definitely new.
My suggestion is that you try version 1.4.3
for now, until this bug is fixed.