-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: Cannot read property 'id' of undefined #9527
Comments
Here is a smaller repro: function C()
{
this.m = null;
}
C.prototype.m = function()
{
this.nothing();
}; It doesn't run out of memory though; when you edit |
The root cause of the crash is that |
I have a fix up at #9574 for the crash. I am trying to compile pixi now and it hasn't run out of memory yet, but it also hasn't finished compiling after a couple of minutes... |
The out-of-memory error happens when a class has a property that's not initialised in the constructor and a method that returns The property that's lazily initialised outside the constructor causes an error (that will ultimately be discarded instead of reported). In the course of constructing this error message, the compiler tries to stringify the ES3 'class'. Unfortunately, Salsa represents ES3 'classes' as anonymous types. The stringify code assumes that anonymous types aren't circular, but methods that return The simplest fix is to change ES3 classes not to be anonymous types. However, we should consider not even producing checker errors in Salsa since they will be discarded, even though they may be quite expensive. |
@TheLarkInn and I tried running with |
how did you run it? I naively copied over the three files in {
"compilerOptions": {
"allowJs": true,
"out": "output.js"
},
"files": [
"config-optimist.js",
"convert-argv.js",
"webpack.js"
]
} |
OK, I tried copying over everything inside If I apply just the out-of-memory fix, then I see the 'id' crash. Happily, the two fixes together allow TypeScript to compile webpack. tl;dr: It works now. |
Yay |
TypeScript Version: 1.8.10
I've noticed when I include javascript files in the files array of tsconfig (with allowJS enabled) I sometimes get some unexpected compile errors.
I've found a consistent repro with pixi.js. If I include it I get the error:
TypeError: Cannot read property 'id' of undefined at getNodeId
This error occurs with the latest version (4.0.0-rc2) which can be found here: https://github.com/pixijs/pixi.js/releases
Additionally, I tested this with various versions of the library and observed the following
TypeError trace:
Out of memory output
The text was updated successfully, but these errors were encountered: