Update from Angular 7.2.0 to 8.0.0 ng-packagr
See original GitHub issueUpdate Angular 7.2 to 8.0 Strangely named method
Affected Package
ng-packagr\lib\ngc\compile-source-files
at Object.<anonymous> (C:\Users\xxxx\sl_duo-front\node_modules\ng-packagr\lib\ngc\compile-source-files.js:66:19)
at Generator.next (<anonymous>)
at fulfilled (C:\Users\xxxxx\seloger\node_modules\ng-packagr\lib\ngc\compile-source-files.js:4:58)
Is this a regression?
Yes
Description
I have project with one angular application and multiple libs, I tried the update to Angular 8.0.0 from 7.2.0 but the libraries build does not work anymore since :
src/lib/card/directives/card-actions/card-actions.directive.ts(15,3): error TS0: cannot process decorators on strangely named method
🔬 Minimal Reproduction
card-actions.directive.ts(15,3): error TS0: cannot process decorators on strangely named method
L15 is @HostListener('class.ui-card-actions-aligns-end') 'align === "end"': any;
import { Directive, Input, HostBinding, HostListener } from '@angular/core';
/**
* Action section of a card, needed as it's used as a selector in the API.
*/
@Directive({
selector: 'ui-card-actions, [uiCardActions]',
exportAs: 'uiCardActions',
})
export class CardActionsDirective {
/** Position of the actions inside the card. */
@Input() align: 'start' | 'end' = 'start';
@HostBinding('class.ui-card-actions') true: Boolean;
@HostListener('class.ui-card-actions-aligns-end') 'align === "end"': any;
}
🔥 Exception or Error
projects/duo-ui-lib/src/lib/card/directives/card-actions/card-actions.directive.ts(15,3): error TS0: cannot process decorators on strangely named method
Error: projects/duo-ui-lib/src/lib/card/directives/card-actions/card-actions.directive.ts(15,3): error TS0: cannot process decorators on strangely named method
at Object.<anonymous> (C:\Users\xxx\my_super_project\node_modules\ng-packagr\lib\ngc\compile-source-files.js:66:19)
at Generator.next (<anonymous>)
at fulfilled (C:\Users\xxx\my_super_project\node_modules\ng-packagr\lib\ngc\compile-source-files.js:4:58)
🌍 Your Environment
**Angular Version: 8.0.0
Angular CLI: 8.0.1
Node: 12.4.0
OS: win32 x64
Angular: 8.0.0
... animations, cdk, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Package Version
------------------------------------------------------------
@angular-devkit/architect 0.800.1
@angular-devkit/build-angular 0.800.1
@angular-devkit/build-ng-packagr 0.800.1
@angular-devkit/build-optimizer 0.800.1
@angular-devkit/build-webpack 0.800.1
@angular-devkit/core 8.0.1
@angular-devkit/schematics 8.0.1
@angular/cli 8.0.1
@ngtools/json-schema 1.1.0
@ngtools/webpack 8.0.1
@schematics/angular 8.0.1
@schematics/update 0.800.1
ng-packagr 5.3.0
rxjs 6.5.2
typescript 3.4.5
webpack 4.30.0
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Angular Update Guide
Select the options that match your update. Angular versions. From v. 16.0, 15.0, 14.0, 13.0, 12.0, 11.0, 10.2, 10.1, 10.0, 9.1, 9.0, 8.2,...
Read more >How to update Angular 7 to Angular 8 by ng update
As of today it is alread stable 8.0.0 :) You might want to try to run ng update --all to update all packages...
Read more >How to update local Angular CLI version? in package.json file ...
In this short tutorial, we will discuss a very common question on How to keep Angular's local and global packages updated?
Read more >Upgrade From Angular 7 to Angular 8 in 10 Minutes
You'll need to install all Angular dependencies with the @8.0.0 tag. I'm only giving you the necessary information, without the nonsense, so you...
Read more >Angular CLI Versions
There are 433 other projects in the npm registry using @angular/cli. ... TypeScript icon, indicating that this package has built-in type declarations.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@JoostK Allowing writing this is a BUG, see https://github.com/angular/angular/issues/18698 for more information.
This is actually tsickle: https://github.com/angular/tsickle/blob/0ceb7d6bc47f6945a6c4c09689f1388eb48f5c07/src/decorator_downlevel_transformer.ts#L408-L420
Could you check if your
tsconfig.json
ortsconfig.app.json
files contain the Angular compiler optionannotateForClosureCompiler
, I guess it’s set totrue
. Since tsickle doesn’t support the syntax you’re using, flipping it tofalse
disables tsickle. I don’t see though what has changed since 7.2 for this to have stopped working. I have no idea what you’re trying to achieve anyway, as that code sample makes no sense to me.I am tempted to classify this bug as not being with the Angular framework itself, but in tooling instead.