ngx-moment: MomentModule not defined

I am using 1.0.0_beta.2 with Angular2 and Ionic 2 RC0 . When I try to build my application, I get the following error. Please help!

[10:46:26] rollup: Export 'MomentModule' is not defined by '/angular2-app/.tmp/app/app.module.ngfactory.js'

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 3
  • Comments: 17 (8 by maintainers)

Commits related to this issue

Most upvoted comments

Here’s the error that I get

[20:26:08] Error: Module ~myaapp/node_modules/angular2-moment/module.js does not export MomentModule (imported by ~myaapp/.tmp/app/app.module.js)

The following works perfectly for me - inside app.module.ts:

import { MomentModule  } from 'angular2-moment/module';

Then add MomentModule to the list of imports:

imports: [
    IonicModule.forRoot(MyApp),
    MomentModule
],

Can you please verify if you have the following file?

node_modules/angular2-moment/module.metadata.json

If it is missing, please remove the angular2-moment directory and reinstall it.