Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: Unexpected value 'undefined' exported by the module

Tags:

angular

I am building an angular 4 application using cli . I have created a shared module and importing that module in my appmodule and moviemodule. I am getting a compile time error Uncaught Error: Unexpected value 'undefined' exported by the module 'SharedModule'

Could somebody tell me what the problem is I double checked the syntax. Am I missing something here

Error message

enter image description here

shared module

import { NgModule }            from '@angular/core';
import { CommonModule }        from '@angular/common';
import { FormsModule }         from '@angular/forms';
import { GridModule } from '@progress/kendo-angular-grid';


@NgModule({
  imports:      [ CommonModule
                    , GridModule ],

  exports:      [ 
                    , CommonModule
                    , FormsModule 
                    , GridModule 
                    ]
})
export class SharedModule { }

App module

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import {FormsModule} from '@angular/forms';
import {HttpModule} from '@angular/http'
import { AppComponent } from './app.component';
import { NavbarComponent } from './navbar/navbar.component';
import { TopbarComponent } from './topbar/topbar.component';
import { FooterbarComponent } from './footerbar/footerbar.component';
import { MRDBGlobalConstants } from './shared/mrdb.global.constants';
import {AppRoutingModule} from './app.routing';
import {HomeComponent} from './home/home.component';
import {MovieComponent} from './movie/movie.component';
import { MRDBCommonService } from './shared/services/mrdb.common.service';
import { NotFoundComponent } from './not-found/not-found.component';
import { SharedModule } from './shared/shared.module';


@NgModule({
  declarations: [
    AppComponent,
    FooterbarComponent,
    TopbarComponent,
    NavbarComponent,
    MovieComponent,
    HomeComponent,
    NotFoundComponent  
  ],
  imports: [
    BrowserModule,
    HttpModule,
    SharedModule,
    AppRoutingModule
  ],
  providers: [MRDBGlobalConstants,
              MRDBCommonService],
  bootstrap: [AppComponent]
})
export class AppModule { }

Movie module

import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import {MovieComponent} from './movie.component';
import { SharedModule }    from '../shared/shared.module';

@NgModule({
  imports: [
       SharedModule
  ],
  exports: [MovieComponent],
  declarations: [MovieComponent]
})
export class MovieModule { }
like image 301
Tom Avatar asked Jul 02 '17 17:07

Tom


1 Answers

Remove comma front of CommonModule

exports: [ 
 remove this => , CommonModule 
                , FormsModule 
                , GridModule 
            ]
like image 143
yurzui Avatar answered Nov 18 '22 13:11

yurzui