question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MomentModule not defined

See original GitHub issue

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'

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
sg1705commented, Oct 4, 2016

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)

1reaction
urishcommented, Oct 3, 2016

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

angular - Importing MomentModule but told pipe not found
I'm using Moment for Angular 2 and am stuck. I've followed the instructions, installing angular-moment via NPM and importing MomentModule into ...
Read more >
Error: 'moment' module not found? - npm
Hello, as of this morning, I've noticed that those of my notebooks that use the moment npm module, return this error message when...
Read more >
ReferenceError: moment is not defined in JavaScript
The "ReferenceError: moment is not defined" error occurs for 2 reasons: Not installing and importing the moment package in a Node.js application. Not...
Read more >
ngx-moment
import { MomentModule } from 'ngx-moment'; @NgModule({ imports: ... The key is a unit defined as one of ss , s , m...
Read more >
[Solved]-"moment is not defined" using moment.js-moment.js
Coding example for the question "moment is not defined" using moment.js-moment.js. ... moment-duration-format.d.ts Definition Not Extending Moment Module ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found