Issue encountered during Angular 6 AOT compilation: Decorators do not support function calls

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 {}

Answer №1

The issue has been resolved in the latest release 7.0.0-beta.1. Keep up the great work with your coding tasks!

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Is it impossible to use type as a generic in TypeScript?

Struggling with TypeScript in React and encountered an issue. I decided to use a generic to build an abstracted class related to Axios. However, I ran into an ESLint error when using any as the type parameter for my generic. ESLint: Unexpected any. Specif ...

Tap into the live monitoring feature of angular-cli build

Is there a way to integrate custom functionality with angular-cli's build/watch command? ng build /w This command creates files and places them in the project's /dist folder I am looking to automatically copy the contents of the dist folder ...

There seems to be an issue with Bootstrap's table-hover class causing some trouble. I could really use some assistance in resolving this

I have implemented a website with a floating reload button. Additionally, I have included a table that utilizes Bootstrap's table-hover class. However, when I hover over a row in the table, the table-hover effect highlights the row (refer to Image 1), ...

Troubleshooting the display of API-generated lists in Angular 8

I am encountering an issue in Angular 8 when trying to display my list on a page. Below is the code from my proposal-component.ts file: import { Component, OnInit, Input } from "@angular/core"; import { ActivatedRoute, Params } from "@angular/router"; imp ...

Is there a method to iterate through dynamically added nested arrays, similar to the Russian Matryoshka dolls?

I am facing a challenge in my Angular TypeScript class where I need to define a function that can loop through dynamically added nested arrays. The issue arises because my template displays a custom Kendo grid which requires me to traverse a type of "Matri ...

Using Angular to invoke a method from a subclass

I am currently utilizing a RAD software that automatically creates Angular code for me. Each time, it generates two components: one is the "generated" component and the other is an empty component where you can add your own custom functions. In this scen ...

Trouble with punctuation marks causing difficulty in obtaining address information within an Ionic Angular app

I am currently working on a project in Ionic Angular where I need to fetch and display user address details from the backend on an HTML page. The address details consist of three fields: Address line1 (mandatory), Address line2, and Address line3 (non-ma ...

Error: _CoalescedStyleScheduler provider not found

I'm currently attempting to follow a tutorial on Angular Material pagination, but I keep encountering this error: ERROR Error: Uncaught (in promise): NullInjectorError: StaticInjectorError(AppModule)[MatTable -> _CoalescedStyleScheduler]: Static ...

Using the CdkDragDrop functionality alongside the ngTemplateOutlet

I'm experimenting with the Drag&Drop functionality introduced in Angular Material 7. To make my template more modular, I've utilized ngTemplateOutlet to create reusable components. Each option can either be a primary Thing™ or a nested Thi ...

Visual Studio 2015 is struggling to locate a specific module, yet the command line interface for

Recently, I delved into the world of TypeScript in VS2015 and so far, it has been a smooth journey. I managed to establish a structure that compiled and performed as anticipated. However, things took a turn when I attempted to incorporate npm-installed mo ...

Tips on updating icons automatically

Incorporating Ionic Angular, Font Awesome, and Stripe into my app, I encounter a challenge. I aim to dynamically change the icon on the HTML page based on data received from the server in the .ts page. This is the current setup: <ion-item *ngFor="let ...

Compilation in AOT mode encountered an error due to an unexpected occurrence of the value 'null' in the AppModule file

Attempting to enable AOT compilation in Angular, I've encountered a specific error: 'Unexpected value 'null' declared by the module 'AppModule' In my project, I am utilizing PrimeNg modules, AGgrid, and ng2-adal. After adju ...

Adding corresponding classes to the body element based on the selected radio button in Angular 6

Is there a way to dynamically add a class to the body tag and the parent element when clicking on radio buttons? For example, consider the following code snippet: <form action=""> <input type="radio" value="layout1">Layout 1<br> <i ...

Angular Material Dropdown with Multi-Column Support

I'm working on customizing the selection panel layout to display items in multiple columns. However, I'm facing an issue where the last item in each column appears off-center and split, causing overflow into the next column instead of a vertical ...

What are some ways to determine if an Angular toggle-switch has been activated by a click?

I am currently working on determining the state of Angular's toggle-switch using Selenium and Python tools. When I open a new form, my input id contains the classes ng-untouched ng-pristine ng-valid. Upon clicking it, the classes change to ng-valid n ...

Troubleshoot: Issue with injecting external component into another component using directive in Angular 2

I need the child component template to be loaded into the parent component template. (calling them child and parent for simplicity) Here is the child component: import {Component,Directive, ElementRef, Input} from '@angular/core'; import {IONIC ...

What is the proper way to access a static property of a child class from a non-static method within the parent class?

I'm attempting to access a static property defined in a child class from a non-static method in the parent class, but I can't seem to find a way to make it work. Is this scenario possible at all? class Parent { static staticList: { a: ...

Encountering a TypeScript error while calling a Vue lifecycle hook method

Struggling to call a method in a Vue root component from a lifecycle method in typescript? See below for a simple example that showcases this issue: import Vue from "vue"; class Game { a: number; b: number; constructor() { this.a = 3; ...

Simulating Express Requests using ts-mockito in Typescript

Is there a way to simulate the Request class from Express using ts-mockito in typescript? I attempted the following import { Request, Response } from "express"; const request = mock(Request); const req: Request = instance(request); but encou ...

modification of class into hooks, receiving error message 'then' property is not found in type '(dispatch: any) => Promise<void>'

As a newcomer to React hooks, I have been converting code from class components to hooks. However, I am encountering an error message when trying to use 'then' in hooks that says 'Property 'then' does not exist on type '(dispa ...