Skip to content

ERROR in : TypeError: Cannot read property 'text' of undefined #9036

@dalla777

Description

@dalla777

Versions

Angular CLI: 1.6.3
Node: 6.11.4
OS: win32 x64
Angular: 5.1.2
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... platform-server, router

@angular/cli: 1.6.3
@angular/http: 4.4.6
@angular-devkit/build-optimizer: 0.0.36
@angular-devkit/core: 0.0.22
@angular-devkit/schematics: 0.0.42
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.3
@schematics/angular: 0.1.11
@schematics/schematics: 0.0.11
typescript: 2.4.2
webpack: 3.10.0

Repro steps

  1. npm start (compiles fine)
  2. edit and save a file
  3. The following error when it tries to re-compile

Observed behavior


ERROR in : TypeError: Cannot read property 'text' of undefined
    at getErrorSpanForNode (/usr/local/src/angular/node_modules/typescript/lib/typescript.js:7304:39)
    at createDiagnosticForNodeInSourceFile (/usr/local/src/angular/node_modules/typescript/lib/typescript.js:7229:20)
    at Object.createDiagnosticForNode (/usr/local/src/angular/node_modules/typescript/lib/typescript.js:7225:16)
    at error (/usr/local/src/angular/node_modules/typescript/lib/typescript.js:27167:22)
    at resolveExternalModule (/usr/local/src/angular/node_modules/typescript/lib/typescript.js:28226:17)
    at resolveExternalModuleNameWorker (/usr/local/src/angular/node_modules/typescript/lib/typescript.js:28213:20)
    at Object.getExternalModuleFileFromDeclaration (/usr/local/src/angular/node_modules/typescript/lib/typescript.js:47978:32)
    at tryGetModuleNameFromDeclaration (/usr/local/src/angular/node_modules/typescript/lib/typescript.js:15517:50)
    at Object.getExternalModuleNameLiteral (/usr/local/src/angular/node_modules/typescript/lib/typescript.js:15481:20)
    at createRequireCall (/usr/local/src/angular/node_modules/typescript/lib/typescript.js:61248:33)
    at visitExportDeclaration (/usr/local/src/angular/node_modules/typescript/lib/typescript.js:61310:45)
    at sourceElementVisitor (/usr/local/src/angular/node_modules/typescript/lib/typescript.js:61091:28)
    at Object.visitNodes (/usr/local/src/angular/node_modules/typescript/lib/typescript.js:49280:48)
    at transformCommonJSModule (/usr/local/src/angular/node_modules/typescript/lib/typescript.js:60834:40)
    at transformSourceFile (/usr/local/src/angular/node_modules/typescript/lib/typescript.js:60808:27)
    at /usr/local/src/angular/node_modules/typescript/lib/typescript.js:2492:86

Desired behavior

Have a non-failing build

Mention any other details that might be useful (optional)

I see this issue was a problem previously in #8216, and it looks like a few other people are also having this problem more recently, although I don't see an issue for it (if there is one, sorry for the dupe).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions