Skip to content

compiler crash TypeError: Cannot read property 'type' of undefined when allowJs=true #16585

@smendola

Description

@smendola

TypeScript Version: 2.5.0-dev.20170616

Attempting to compile with allowJs = true crashes the compiler.
No crash with allowJs = false
I'm not able to localize which .js file causes the problem, as there are a lot.

Expected behavior:
No crash, many code problems reported

Actual behavior:
Compiler crashes, nothing reported, just a stack trace.

% tsc
/usr/lib/node_modules/typescript/lib/tsc.js:55789
                throw e;
                ^

TypeError: Cannot read property 'type' of undefined
    at resolveBaseTypesOfClass (/usr/lib/node_modules/typescript/lib/tsc.js:22130:73)
    at getBaseTypes (/usr/lib/node_modules/typescript/lib/tsc.js:22089:25)
    at checkClassLikeDeclaration (/usr/lib/node_modules/typescript/lib/tsc.js:34332:33)
    at checkClassDeclaration (/usr/lib/node_modules/typescript/lib/tsc.js:34302:13)
    at checkSourceElement (/usr/lib/node_modules/typescript/lib/tsc.js:35211:28)
    at Object.forEach (/usr/lib/node_modules/typescript/lib/tsc.js:289:30)
    at checkSourceFileWorker (/usr/lib/node_modules/typescript/lib/tsc.js:35280:20)
    at checkSourceFile (/usr/lib/node_modules/typescript/lib/tsc.js:35265:13)
    at Object.forEach (/usr/lib/node_modules/typescript/lib/tsc.js:289:30)
    at getDiagnosticsWorker (/usr/lib/node_modules/typescript/lib/tsc.js:35330:16)

Config:

    "compilerOptions": {
        "module": "es6",
        "target": "es5",
        "outDir": "lib",
        "noImplicitAny": false,
        "sourceMap": true,
        "declaration": false,
        "pretty": true,
        "skipLibCheck": false,
        "strictNullChecks": true,
        "allowJs": true
    },

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