Skip to content

bug(cdk): Update Failed : Cannot read property 'length' of null #19779

@filol

Description

@filol

Reproduction

I can't share my code because it's a big project, hope the stack will help you
ng update @angular/material --force

Expected Behavior

Working

Actual Behavior

 ** Executing migrations for package '@angular/cdk' **
Cannot read property 'length' of null

Stack trace in log file :

[error] TypeError: Cannot read property 'length' of null
    at Object.computeLineStartsMap (path\node_modules\@angular\cdk\schematics\update-tool\utils\line-mappings.js:39:23)
    at ComponentResourceCollector.resolveExternalStylesheet (path\node_modules\@angular\cdk\schematics\update-tool\component-resource-collector.js:131:47)
    at path\node_modules\@angular\cdk\schematics\update-tool\index.js:97:50
    at Array.forEach (<anonymous>)
    at UpdateProject.migrate (path\node_modules\@angular\cdk\schematics\update-tool\index.js:95:35)
    at runMigrations (path\node_modules\@angular\cdk\schematics\ng-update\devkit-migration-rule.js:128:42)
    at Object.<anonymous> (path\node_modules\@angular\cdk\schematics\ng-update\devkit-migration-rule.js:83:17)
    at Generator.next (<anonymous>)
    at path\node_modules\@angular\cdk\schematics\ng-update\devkit-migration-rule.js:15:71
    at new Promise (<anonymous>)
    at __awaiter (path\node_modules\@angular\cdk\schematics\ng-update\devkit-migration-rule.js:11:12)
    at path\node_modules\@angular\cdk\schematics\ng-update\devkit-migration-rule.js:57:31
    at MergeMapSubscriber.project (path\node_modules\@angular-devkit\schematics\src\rules\call.js:75:24)
    at MergeMapSubscriber._tryNext (path\node_modules\rxjs\internal\operators\mergeMap.js:69:27)
    at MergeMapSubscriber._next (path\node_modules\rxjs\internal\operators\mergeMap.js:59:18)
    at MergeMapSubscriber.Subscriber.next (path\node_modules\rxjs\internal\Subscriber.js:66:18)

Environment

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 10.0.0
Node: 12.4.0
OS: win32 x64

Angular: 10.0.0
... animations, cdk, cli, common, compiler, compiler-cli, core
... forms, language-service, material, platform-browser
... platform-browser-dynamic, router
Ivy Workspace: Yes

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.1000.0
@angular-devkit/build-angular     0.1000.0
@angular-devkit/build-optimizer   0.1000.0
@angular-devkit/build-webpack     0.1000.0
@angular-devkit/core              10.0.0
@angular-devkit/schematics        10.0.0
@angular/flex-layout              10.0.0-beta.32
@ngtools/webpack                  10.0.0
@schematics/angular               9.1.9
@schematics/update                0.1000.0
rxjs                              6.5.5
typescript                        3.9.5
webpack                           4.43.0
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows 10

Metadata

Metadata

Labels

P2The issue is important to a large percentage of users, with a workaroundarea: cdk/schematicscdk/schematics is *not* a public APIarea: ng-updateIssues related to `ng-update` integration

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions