ng-toolkit icon indicating copy to clipboard operation
ng-toolkit copied to clipboard

Cannot read property 'unshift' of undefined

Open chetanGH opened this issue 4 years ago • 3 comments

When i tried to add ng add @ng-toolkit/universal to my angular app its showing these errors:

  • ERROR: Cannot read property 'unshift' of undefined

  • INFO: stacktrace has been sent to tracking system. For more info about my workspace: / \ _ __ __ _ _ | | __ _ _ __ / | | | | / △ \ | ' \ / _ | | | | |/ _ | '| | | | | | | / ___ | | | | (| | || | | (| | | | || | | | // __| ||_, |_,||_,|| _||| |___/

Angular CLI: 8.1.3 Node: 12.13.0 OS: win32 x64 Angular: 8.1.3 ... animations, cli, common, compiler, compiler-cli, core, forms ... language-service, platform-browser, platform-browser-dynamic ... router

Package Version

@angular-devkit/architect 0.801.3 @angular-devkit/build-angular 0.801.3 @angular-devkit/build-optimizer 0.801.3 @angular-devkit/build-webpack 0.801.3 @angular-devkit/core 8.1.3 @angular-devkit/schematics 8.1.3 @ngtools/webpack 8.1.3 @schematics/angular 8.1.3 @schematics/update 0.801.3 rxjs 6.4.0 typescript 3.4.5 webpack 4.35.2

Any help would be appreciated. Thanks in advance ;-)

chetanGH avatar Feb 24 '20 08:02 chetanGH

Do you use lazy loading somewhere on routing definitions?

KingDarBoja avatar Feb 24 '20 15:02 KingDarBoja

Thanks for the response @KingDarBoja. Yeah. I've used lazzy loading on app-routing.module.ts file and then imported as usual app.module.ts. thing is its worked for me if i do "ng serve", when i tried to prod build its triggering this issue.

chetanGH avatar Feb 26 '20 04:02 chetanGH

Having this same issue. Also using lazy loading on routes.

RyanRutkin avatar Apr 26 '20 03:04 RyanRutkin