Unable to get property 'isError' of undefined or null reference
This is very odd but I have 17 projects in my solution and one of them contains a number of typescript files that define a number of common classes and interfaces. These are all referenced using a _references.d.ts file. About 3 of my other projects use these files and I simply reference them by adding a reference in another _references.d.ts file locally and then referencing that local file in the typescript file.
Only one of them does not work when I include that reference in the local _references.d.ts file. As soon as I do I get this error. If I take out the reference to the common _references.d.ts file it compiles fine. But I've also noticed that if I reference this common _references.d.ts file from within any typescript file within this project then it produces this error. Because it causes an error not a warning I can no longer compile my solution!
This is extremely worrying, is there anything I can do to correct this please?
The only other difference that may be significant is that all the projects that compile fine with this reference are class library assemblies, but the one having this issue is a web application.
Managed to narrow it down to one line but I am unable to replicate without entire project but the line seems to indicate it has something to do with calling a static property on a variable that is the type of a class, i.e:
class TestClass {
public static get Test() {
return {};
}
}
var myTestVar: typeof TestClass=null;
myTestVar=TestClass;
var myTestVarResult=myTestVar.Test;
It would seem to be the last line that would be causing me this issue. If I run this though on its own like this it works fine, so I can't replicate it unfortunately.
Could you send us a zip file with your code (ryanca at microsoft dot com)? It's going to be hard to diagnose otherwise.