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.

Module 'moment' has no exported member 'UnitOfTime'

See original GitHub issue

Description of the Issue and Steps to Reproduce:

I’m getting the error ERROR in [default] /Users/max/project/node_modules/angular2-moment/difference.pipe.d.ts:4:91 when compiling my project.

Duplicate exists #91 but installing typescript definitions from typings, and from @types/moment did not fix the issue.

Please describe the issue and steps to reproduce, preferably with a code sample / plunker:

I’ve installed the pikaday datepicker that relies on the moment typescript definition file to export several classes, one of which is UnitOfTime.

As far as I can tell, my problem comes from the fact that the typescript definition file for moment included in angular2-moment doesn’t export UnitOfTime.

Environment:

  • Angular version?

2.0.0-beta.5

  • TypeScript version?

2.0.0

  • moment version?

“moment”: “^2.15.0”,

  • Are you using moment-timezone?

no

  • Are you using the angular-cli?

np

  • Using Rollup/Webpack/System.js/Ionic/similar?

webpack

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:15 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
artdias90commented, Nov 10, 2016

+1

1reaction
adamreisnzcommented, Nov 20, 2016

Reverting moment to 2.15.2 worked for us.

@chadbr If the definition changes and UnitOfTime is no longer valid, then that should be a major version bump as it’s a breaking change…

Ref: https://github.com/moment/moment/issues/3589

Read more comments on GitHub >

github_iconTop Results From Across the Web

Module 'moment' has no exported member 'UnitOfTime ...
I updated the ionic-app-scripts to 0.0.42 and on process 'transpile', I got the following error: [14:21:19] transpile started .
Read more >
"moment" has no exported member 'default' - angular
I'm using moment. js to change the local date format for my application but getting the following error: "moment" has no exported member...
Read more >
module '"moment"' has no exported member 'default'.ts ... - You.com
As far as I can tell, my problem comes from the fact that the typescript definition file for moment included in angular2-moment doesn't...
Read more >
node_modules/moment/moment''' has no default export
Module 'moment' has no exported member 'UnitOfTime' Had to disable type checking in tsconfig.json with "skipLibCheck": true Not that typescript needs to ...
Read more >
angular2-moment | Yarn - Package Manager
This module works with Angular 2.0 and above. For the AngularJS version of this module, please see angular-moment. Installation. npm install --save angular2- ......
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