Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Function calls are not supported in decorators but 'ɵmakeDecorator' was called in 'NgModule' 'NgModule' calls 'ɵmakeDecorator'

Tags:

angular

I am trying all the solutions in this link:

https://stack247.wordpress.com/2018/09/07/angular-all-possible-solutions-for-no-ngmodule/

and nothing seems useful, this happens when I try to use ng b --prod. I cannot understand the error.

Function calls are not supported in decorators but 'ɵmakeDecorator' was called in 'NgModule' 'NgModule' calls 'ɵmakeDecorator'

Code:

import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';

import { NgModule } from '@angular/Core';
import { Route, RouterModule } from '@angular/router';

import { APP_BASE_HREF } from '@angular/common'
import { HttpClientModule } from '@angular/common/http';

import { SocialLoginModule,
         AuthServiceConfig,
         GoogleLoginProvider } from 'angular5-social-login';
import { NgbModule,
         NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
import { CookieService } from 'ngx-cookie-service';

import { AppComponent } from './app.component';
import { LoginComponent } from './login/login.component';
import { HomeComponent,
         NgbdModalsuccess,
         NgbdModaluploadfailed } from './home/Home.component'
import { User } from './commen/user';
import { Image } from './commen/image';

export const ROUTES: Route[] = [
  { path: '', component: LoginComponent },
  { path: 'home', component: HomeComponent }
]

const config = new AuthServiceConfig([
  {
    id: GoogleLoginProvider.PROVIDER_ID,
    provider: new GoogleLoginProvider('810260133980-m5ga3v7sglugi287eu2r0215p06e8gln.apps.googleusercontent.com')
  }
])

export function ProvideConfig() {
  return config;
}

@NgModule({
  declarations: [
    AppComponent,
    LoginComponent,
    HomeComponent,
    NgbdModalsuccess,
    NgbdModaluploadfailed,
  ],

  imports: [
    BrowserModule,
    RouterModule.forRoot(ROUTES),
    SocialLoginModule,
    HttpClientModule,
    NgbModule,
  ],

  providers: [
    { provide: 'ROUTES', useValue: ROUTES },
    { provide: APP_BASE_HREF, useValue : '/' },
    { provide: AuthServiceConfig, useFactory: ProvideConfig },

    CookieService,
    User,
    Image,
    BrowserAnimationsModule,
    NgbActiveModal,
  ],

  entryComponents:[
    NgbdModaluploadfailed,
    NgbdModalsuccess
  ],
  exports: [ RouterModule ],
  bootstrap: [ AppComponent ]
})

export class AppModule {

}
like image 684
Huda Twfik Avatar asked Jan 23 '19 12:01

Huda Twfik


1 Answers

I got the same issue today.

In the above code check the imports line no 3:

import { NgModule } from '@angular/Core';

System module names are case sensitive. Update it to below:

import { NgModule } from '@angular/core';

That resolves the issue.

like image 174
Sreejith K Avatar answered Sep 29 '22 01:09

Sreejith K