I recently added the ng-intercom
library to my Angular Project by following the instructions from (https://www.npmjs.com/package/ng-intercom). After implementing it, everything seemed to work fine in ng serve
mode. However, when I tried to build using either ng build --prod
or ng build --aot
, I encountered the following error:
ERROR in Error during template compile of 'AppModule'
Function calls are not supported in decorators but 'IntercomModule' was called.
The strange thing is that it works perfectly when I use ng build
.
Shown below is a snippet from my AppModule
:
import { IntercomModule } from 'ng-intercom';
@NgModule({
declarations: [MyComponent],
imports: [
BrowserModule,
BrowserAnimationsModule,
HttpClientModule,
IntercomModule.forRoot({
appId: 'my_id',
updateOnRouterChange: true,
}),
],
providers: [],
bootstrap: [MyComponent],
})
export class AppModule {}