Skip to content

TypeError: Cannot read property 'id' of undefined #9527

Closed
@itslenny

Description

@itslenny

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

  • version > 3.0.7 - TypeError: Cannot read property 'id' of undefined at getNodeId
  • version > 3.0.0 - Out of memory
  • versions 2.x - compiles as expected

TypeError trace:

TypeError: Cannot read property 'id' of undefined at getNodeId node_modules\typescript\lib\tsc.js:11646:18)
    at getNodeLinks node_modules\typescript\lib\tsc.js:12007:26)
    at checkExpressionCached node_modules\typescript\lib\tsc.js:20308:25)
    at node_modules\typescript\lib\tsc.js:13842:107
    at Object.map node_modules\typescript\lib\tsc.js:163:29)
    at getTypeOfVariableOrParameterOrProperty node_modules\typescript\lib\tsc.js:13842:57)
    at getTypeOfSymbol node_modules\typescript\lib\tsc.js:13958:24)
    at checkPropertyAccessExpressionOrQualifiedName node_modules\typescript\lib\tsc.js:18676:20)
    at checkPropertyAccessExpression node_modules\typescript\lib\tsc.js:18651:20)
    at checkExpressionWorker node_modules\typescript\lib\tsc.js:20394:28)

Out of memory output

<--- Last few GCs --->

13865 ms: Scavenge 1400.5 (1456.8) -> 1400.5 (1456.8) MB, 5.9 / 0 ms (+ 1.0 ms in 1 steps since last GC) [allocation failure] [incremental marking delaying mark-sweep].
14659 ms: Mark-sweep 1400.5 (1456.8) -> 1400.5 (1456.8) MB, 794.0 / 0 ms (+ 2.0 ms in 2 steps since start of marking, biggest step 1.0 ms) [last resort gc].
15458 ms: Mark-sweep 1400.5 (1456.8) -> 1399.0 (1456.8) MB, 799.4 / 0 ms [last resort gc].


<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0000027F7EA44A59 <JS Object>
    1: writeType(aka writeType) [node_modules\typescript\lib\tsc.js:13040] [pc=000001EB383DA8F4] (this=0000027F7EA04139 <undefined>,type=0000014D71F4DAB9 <a Type with map 000002E0B4251E69>,flags=8)
    2: buildTypeDisplay [node_modules\typescript\lib\tsc.js:~13035] [pc=000...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions