AOT Compiling Error - Function calls are not supported in decorators but 'MetaModule' was called
See original GitHub issueI’m submitting a … (check one with “x”)
[x] Bug report
Current behavior When trying to compile my Angular 9 app with AOT, I’m getting the following error:
ERROR in Error during template compile of 'SharedModule'
Function calls are not supported in decorators but 'MetaModule' was called.
Unexpected value 'undefined' imported by the module 'SharedModule in /src/app/shared/shared.module.ts'
Can't export value MetaModule in /node_modules/@ngx-meta/core/meta.module.d.ts from SharedModule in /src/app/shared/shared.module.ts as it was neither declared nor imported!
Error during template compile of 'SharedModule'
Function calls are not supported in decorators but 'MetaModule' was called.
export const metaFactory = (): MetaStaticLoader =>
new MetaStaticLoader({
pageTitlePositioning: PageTitlePositioning.PrependPageTitle,
pageTitleSeparator: ' - ',
applicationName: 'XYZ',
defaults: {
title: 'XYZ',
description: 'xyz',
}
});
@NgModule({
...
imports: [
MetaModule.forRoot({
provide: MetaLoader,
useFactory: metaFactory
})
]
exports: [
...
MetaModule
]
});
When I remove this package from the modules, it is able to compile properly.
Expected/desired behavior Able to compile with @ngx-meta/core with AOT
Environment
- Angular version: 9.1.0
Issue Analytics
- State:
- Created 3 years ago
- Reactions:9
- Comments:7 (1 by maintainers)
Top Results From Across the Web
How to get rid of Function calls are not supported in ...
ERROR in Error during template compile of 'AppModule' Function calls are not supported in decorators but 'ChartModule' was called. Now, i know ...
Read more >Solving AOT Error in NgRx: Function calls are not supported in ...
... Error during template compile of 'AppModule' Function calls are not supported in decorators but 'createAction' was called in 'reducers'.
Read more >Function calls are not supported in decorators while ng build ...
ERROR in Error during template compile of 'AppModule' Function calls are not supported in decorators but 'BsDropdownModule' was called.
Read more >AOT metadata errors - Angular
Function calls are not supported. Consider replacing the function or lambda with a reference to an exported function. The compiler does not currently...
Read more >Function calls are not supported in decorators but '' was called
Similar code works fire with another Ionic 5 Angular 9 project I created. Is this an Angular 10 issue or a typescript issue?...
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 FreeTop 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
Top GitHub Comments
if you use Angular version less then 9 try to install version of package less then 8 ,for my app with v8.2 version 8.0.2 compiled!
Same issue on Angular CLI 9.1.8