ng-lazyload-image: Angular6 - ng build / serve --prod - Error during template compile of 'AppModule'
I have this problem when I’m building or seving an Angular6 application for PROD with ng serve --prod or ng build --prod
ERROR in app/app.module.ts(84,47): Error during template compile of 'AppModule'
Complex function calls are not supported. in 'intersectionObserverPreset'
'intersectionObserverPreset' references 'intersectionObserverPreset'
'intersectionObserverPreset' references 'intersectionObserverPreset'
'intersectionObserverPreset' contains the error.
This is what I have in the line app/app.module.ts(84,47)
import { LazyLoadImageModule, intersectionObserverPreset } from 'ng-lazyload-image';
@NgModule({
imports: [
...,
/*84 -->*/ LazyLoadImageModule.forRoot({ preset: intersectionObserverPreset }) /*<-- 84*/
],
declarations: [...],
entryComponents [...],
providers: [...],
bootstrap: [...]
})
Versions:
angular: 6.1.0
ng-lazyload-image: 5.0.0
npm: 5.6.0
node: 8.11.4
typescript: 2.7.2
It seems to have something to do with AOT but I can’t find a way to fix it. This error does not occur when normally running the commands ng build or ng serve
I appreciate any help
Thanks!
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 19 (7 by maintainers)
Commits related to this issue
- Added project for https://github.com/tjoskar/ng-lazyload-image/issues/368 — committed to tjoskar/ng-lazyload-image-bugs by tjoskar 5 years ago
I have the exactly same issue, and I am using angular version 7. It wokrs on ‘ng serve’ but not ‘ng build --prod --aot’
is there any solution for the issue?