New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Angular 10-rc.0 library build failures #37330
Comments
Did you try wiping out the node_modules and doing a fresh install? |
The reproduction has a GitHub action setup that runs a fresh install to test, and shows the error. I have tried this though locally with no luck. |
Hmm, so this is weird... In the ClrPopoverContent.ctorParameters = () => [
{ type: HTMLDocument, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
{ type: ViewContainerRef },
{ type: TemplateRef },
{ type: Renderer2 },
{ type: ClrPopoverPositionService },
{ type: ClrPopoverEventsService },
{ type: ClrPopoverToggleService }
];
...
ClrPopoverContent = __decorate([
Directive({ selector: '[clrPopoverContent]' }),
__param(0, Inject(DOCUMENT))
], ClrPopoverContent); Notice that the first statement decorates the class with constructor parameter information, which is used to compute injection providers. The second statement is decorating the class again, this time with the I believe that ngcc is only reading the parameter information from the second statement, which is why it is not getting the information needed for the subsequent parameters. I am not sure if this is a bug in the TS compiler, or something to do with how ng-packagr bundles the classes. It is possible that we could tweak ngcc to be tolerant of this, but it is worth finding out if there is a bug/fix upstream that would solve it first. |
Compiling only with ClrPopoverContent = __decorate([
Directive({ selector: '[clrPopoverContent]' }),
__param(0, Inject(DOCUMENT)),
__metadata("design:paramtypes", [HTMLDocument,
ViewContainerRef,
TemplateRef,
Renderer2,
ClrPopoverPositionService,
ClrPopoverEventsService,
ClrPopoverToggleService])
], ClrPopoverContent); |
It looks like the output has always been like this: https://unpkg.com/browse/@clr/angular@3.1.3/fesm2015/clr-angular.js So it must be that ngcc is no longer as tolerant to this. I'll take a look next week. |
I believe ng-packagr has been transforming the See #30106 and ng-packagr/ng-packagr#1401. |
Now in TS 3.9, classes in ES2015 can be wrapped in an IIFE. This commit ensures that we still find the static properties that contain decorator information, even if they are attached to the adjacent node of the class, rather than the implementation or declaration. Fixes angular#37330
Now in TS 3.9, classes in ES2015 can be wrapped in an IIFE. This commit ensures that we still find the static properties that contain decorator information, even if they are attached to the adjacent node of the class, rather than the implementation or declaration. Fixes angular#37330
…37436) Now in TS 3.9, classes in ES2015 can be wrapped in an IIFE. This commit ensures that we still find the static properties that contain decorator information, even if they are attached to the adjacent node of the class, rather than the implementation or declaration. Fixes #37330 PR Close #37436
…ngular#37436) Now in TS 3.9, classes in ES2015 can be wrapped in an IIFE. This commit ensures that we still find the static properties that contain decorator information, even if they are attached to the adjacent node of the class, rather than the implementation or declaration. Fixes angular#37330 PR Close angular#37436
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
…ngular#37436) Now in TS 3.9, classes in ES2015 can be wrapped in an IIFE. This commit ensures that we still find the static properties that contain decorator information, even if they are attached to the adjacent node of the class, rather than the implementation or declaration. Fixes angular#37330 PR Close angular#37436
🐞 bug report
Affected Package
The issue is caused by package @angular/compiler-cli I suspect, or ng-packagr, or typescript.
Is this a regression?
It seems possible.
Description
The build fails massively after updating to 10-rc.0, with the compiler complaining about virtually every directive or service missing. A new CLI project worked with the default vanilla library but not when I added the Clarity library. I suspect the issue is around how Typescript is compiling our library now that the version has been bumped.
The library is built without problems being reported, but when the ivy precompiler runs when building an application, the library cannot be compiled with ivy and the build fails.
🔬 Minimal Reproduction
https://github.com/gnomeontherun/angular-10-library-compiler-issues
Build errors: https://github.com/gnomeontherun/angular-10-library-compiler-issues/runs/717676813?check_suite_focus=true
🔥 Exception or Error
Snippet of some of the errors
🌍 Your Environment
Angular Version:
Anything else relevant?
Our build was working with next-6, but after trying out rc-0 things broke.
The text was updated successfully, but these errors were encountered: