Uncaught Error: Unexpected value 'undefined' imported by the module 'AppModule'

3.4k Views Asked by At

here is my project app module app.module.ts:

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { ServiceService } from './apiServices/service.service';
import { AppComponent } from './app.component';
import { HttpModule  } from '@angular/http';
import { RouterModule, Routes } from '@angular/router';
import { HomeComponent } from './home/home.component';
import { ProfileComponent } from './profile/profile.component';
import { AppRoutingModule } from './app-routing.module';
import { MasonryModule } from 'angular2-masonry';
import { LoadersCssModule } from 'angular2-loaders-css';


const appRoutes: Routes = [
  { path: '', component: HomeComponent },
  { path: 'profile/l/:id', component: ProfileComponent }
];

@NgModule({
  declarations: [
    AppComponent, HomeComponent, ProfileComponent
  ],
  imports: [
    BrowserModule,
    HttpModule,
    MasonryModule,
    RouterModule,
    AppRoutingModule,
    RouterModule.forRoot(appRoutes),
    LoadersCssModule
  ],
  providers: [ServiceService],
  bootstrap: [AppComponent]
})
export class AppModule { }

the following errors appear when adding: import { MasonryModule } from 'angular2-masonry'; and adding MasonryModule to imports

ERROR in ./node_modules/angular2-masonry/index.ts Module build failed: Error: /Users/developer/my-app/node_modules/angular2-masonry/index.ts is not part of the compilation output. Please check the other error messages for details. at AngularCompilerPlugin.getCompiledFile (/Users/developer/my-app/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:625:23) at plugin.done.then (/Users/developer/my-app/node_modules/@ngtools/webpack/src/loader.js:467:39) at process._tickCallback (internal/process/next_tick.js:109:7) @ ./src/app/app.module.ts 16:0-49 @ ./src/main.ts @ multi webpack-dev-server/client?http://0.0.0.0:0 ./src/main.ts

Uncaught Error: Unexpected value 'undefined' imported by the module 'AppModule'
    at syntaxError (compiler.js:466)
    at eval (compiler.js:15095)
    at Array.forEach (<anonymous>)
    at CompileMetadataResolver.getNgModuleMetadata (compiler.js:15072)
    at JitCompiler._loadModules (compiler.js:33542)
    at JitCompiler._compileModuleAndComponents (compiler.js:33503)
    at JitCompiler.compileModuleAsync (compiler.js:33419)
    at CompilerImpl.compileModuleAsync (platform-browser-dynamic.js:230)
    at PlatformRef.bootstrapModule (core.js:5446)
    at eval (main.ts:11)

any help about this issue

0

There are 0 best solutions below