-
Notifications
You must be signed in to change notification settings - Fork 27.1k
Closed
Milestone
Description
🐞 bug report
Affected Package
The issue is caused by package @angular/compiler-cli
Is this a regression?
No
Description
Take a look at this code (taken from https://unpkg.com/@angular/fire@5.1.1/es2015/firebase.app.module.js):
let AngularFireModule = AngularFireModule_1 = class AngularFireModule {
static initializeApp(options, nameOrConfig) {
return {
ngModule: AngularFireModule_1,
providers: [
{ provide: FirebaseOptionsToken, useValue: options },
{ provide: FirebaseNameOrConfigToken, useValue: nameOrConfig }
]
};
}
};
AngularFireModule = AngularFireModule_1 = __decorate([
NgModule({
providers: [FirebaseAppProvider],
})
], AngularFireModule);
export { AngularFireModule };ivy-ngcc cannot recognise the AngularFireModule.initializeApp and mark it as ModuleWithProviders.
This is because the current implementation of ivy-ngcc which looks for ts.ClassDeclaration. Instead, the code above is a variable assignment to ts.BinaryExpression which includes ts.ClassExpression.
There are 2 solutions to this issue:
- Make
ivy-ngccto able to recognise class declaration like this. - Tell library authors to use
angularCompilerOptions.annotationsAsasstatic fieldsduring packaging.
My voice is with solution 2, though.
🔬 Minimal Reproduction
N/A
🔥 Exception or Error
N/A
🌍 Your Environment
Angular Version:
8.0.0-beta.6
Anything else relevant?
This causes #28603.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels