Issue
I was using angular version 10.2 After that i used angular update guide to update first to angular version 11.
So i run ng update @angular/core@11 @angular/cli@11
and the migration to version 11 was sucessfull.
Now when i try to serve my application i get this error
An unhandled exception occurred: Debug Failure. False expression: Class was missing valueDeclaration -OR- non-class had no interface declarations
See "C:\Users\A9783~1.BOS\AppData\Local\Temp\ng-MvFW93\angular-errors.log" for further details.
if i go in the location of the .log in AppData I get full error and it is
[error] Error: Debug Failure. False expression: Class was missing valueDeclaration -OR- non-class had no interface declarations
at getOuterTypeParametersOfClassOrInterface (C:\xecm-migration-two\xecm\xecm-webapp-angular\node_modules\typescript\lib\typescript.js:50194:22)
at getDeclaredTypeOfClassOrInterface (C:\xecm-migration-two\xecm\xecm-webapp-angular\node_modules\typescript\lib\typescript.js:50511:43)
at tryGetDeclaredTypeOfSymbol (C:\xecm-migration-two\xecm\xecm-webapp-angular\node_modules\typescript\lib\typescript.js:50675:24)
at getDeclaredTypeOfSymbol (C:\xecm-migration-two\xecm\xecm-webapp-angular\node_modules\typescript\lib\typescript.js:50671:20)
at getTypeOfGlobalSymbol (C:\xecm-migration-two\xecm\xecm-webapp-angular\node_modules\typescript\lib\typescript.js:53416:24)
at getGlobalType (C:\xecm-migration-two\xecm\xecm-webapp-angular\node_modules\typescript\lib\typescript.js:53439:45)
at initializeTypeChecker (C:\xecm-migration-two\xecm\xecm-webapp-angular\node_modules\typescript\lib\typescript.js:76705:52)
at Object.createTypeChecker (C:\xecm-migration-two\xecm\xecm-webapp-angular\node_modules\typescript\lib\typescript.js:43116:9)
at Object.getTypeChecker (C:\xecm-migration-two\xecm\xecm-webapp-angular\node_modules\typescript\lib\typescript.js:103621:79)
at new NgCompiler (C:\xecm-migration-two\xecm\xecm-webapp-angular\node_modules\@angular\compiler-cli\src\ngtsc\core\src\compiler.js:204:79)
at Function.NgCompiler.fromTicket (C:\xecm-migration-two\xecm\xecm-webapp-angular\node_modules\@angular\compiler-cli\src\ngtsc\core\src\compiler.js:243:28)
at new NgtscProgram (C:\xecm-migration-two\xecm\xecm-webapp-angular\node_modules\@angular\compiler-cli\src\ngtsc\program.js:96:47)
at AngularWebpackPlugin.updateJitProgram (C:\xecm-migration-two\xecm\xecm-webapp-angular\node_modules\@angular-devkit\build-angular\node_modules\@ngtools\webpack\src\ivy\plugin.js:427:36)
at C:\xecm-migration-two\xecm\xecm-webapp-angular\node_modules\@angular-devkit\build-angular\node_modules\@ngtools\webpack\src\ivy\plugin.js:163:24
at SyncHook.eval [as call] (eval at create (C:\xecm-migration-two\xecm\xecm-webapp-angular\node_modules\@angular-devkit\build-angular\node_modules\webpack\node_modules\tapable\lib\HookCodeFactory.js:1:1), <anonymous>:11:1)
at SyncHook.lazyCompileHook (C:\xecm-migration-two\xecm\xecm-webapp-angular\node_modules\@angular-devkit\build-angular\node_modules\webpack\node_modules\tapable\lib\Hook.js:154:20)
Now after the update my package.json looks like this:
"dependencies": {
"@angular/animations": "^11.2.14",
"@angular/common": "~11.2.14",
"@angular/compiler": "~11.2.14",
"@angular/core": "~11.2.14",
"@angular/forms": "~11.2.14",
"@angular/platform-browser": "~11.2.14",
"@angular/platform-browser-dynamic": "~11.2.14",
"@angular/router": "~11.2.14",
"@ng-bootstrap/ng-bootstrap": "7.0.0",
"bootstrap": "4.5.3",
"bootstrap.native": "3.0.13",
"file-saver": "^2.0.2",
"html-lint": "^2.4.2",
"moment": "2.29.1",
"ng2-file-upload": "^1.4.0",
"rxjs": "~6.6.3",
"rxjs-compat": "~6.5.2",
"t2i-scss": "1.0.1",
"tslib": "^2.0.0",
"xcomponent-angular": "^2.1.0",
"zone.js": "0.11.8"
},
what is the problem ? How can i resolve this ?
When i try ng --serve in my project file i get
Angular CLI: 11.2.19
Node: 14.15.5
OS: win32 x64
Angular: 11.2.14
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1002.4
@angular-devkit/build-angular 0.1102.19
@angular-devkit/core 10.2.4
@angular-devkit/schematics 11.2.19
@angular/cli 11.2.19
@schematics/angular 11.2.19
@schematics/update 0.1102.19
rxjs 6.6.7
typescript 4.0.3
Solution
It's caused by a bug in typescript. It can be fixed by upgrading to 4.1.x (e.g 4.1.5).
https://github.com/angular/angular-cli/issues/19317
Answered By - Antonio Vida
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.