Skip to content

TypeError: Cannot read property 'text' of undefined #8216

Closed
@karptonite

Description

@karptonite

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

Angular CLI: 1.5.0-rc.5
Node: 8.8.1
OS: darwin x64
Angular: 5.0.0-rc.7
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, platform-server, router

@angular/cli: 1.5.0-rc.5
@angular-devkit/build-optimizer: 0.0.31
@angular-devkit/core: 0.0.20
@angular-devkit/schematics: 0.0.34
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.8.0-rc.5
@schematics/angular: 0.0.48
typescript: 2.4.2
webpack-bundle-analyzer: 2.9.0
webpack: 3.8.1

Repro steps.

in my package, anyway
ng serve --ssl --public-host=//localhost:4200/sockjs-node/ --deploy-url=//localhost:4200/ --serve-path=/
make a trivial change to a template

The log given by the failure.

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

Desired functionality.

Successful compilation

Mention any other details that might be useful.

After the first build, everything works correctly. But a trivial change to a template or a change to whitspace in a ts file gives the error shown.

Metadata

Metadata

Assignees

Labels

P1Impacts a large percentage of users; if a workaround exists it is partial or overly painfulneeds: investigationRequires some digging to determine if action is neededtype: bug/fix

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions