Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with moment 2.25.0 #235

Closed
tarlepp opened this issue May 1, 2020 · 16 comments
Closed

Problems with moment 2.25.0 #235

tarlepp opened this issue May 1, 2020 · 16 comments

Comments

@tarlepp
Copy link

tarlepp commented May 1, 2020

Description of the Issue and Steps to Reproduce:

Did you search for duplicate issue? [Yes / No]

After I updated my moment to version 2.25.0 I've followed issues when Angular is compiling;

node_1  | ERROR in ./node_modules/ngx-moment/__ivy_ngcc__/fesm2015/ngx-moment.js 237:15-23
node_1  | "export 'duration' was not found in 'moment'
node_1  | ERROR in ./node_modules/ngx-moment/__ivy_ngcc__/fesm2015/ngx-moment.js 606:12-18
node_1  | "export 'isDate' was not found in 'moment'
node_1  | ERROR in ./node_modules/ngx-moment/__ivy_ngcc__/fesm2015/ngx-moment.js 68:52-60
node_1  | "export 'isMoment' was not found in 'moment'
node_1  | ERROR in ./node_modules/ngx-moment/__ivy_ngcc__/fesm2015/ngx-moment.js 609:17-25
node_1  | "export 'isMoment' was not found in 'moment'
node_1  | ERROR in ./node_modules/ngx-moment/__ivy_ngcc__/fesm2015/ngx-moment.js 621:15-23
node_1  | "export 'isMoment' was not found in 'moment'
node_1  | ERROR in ./node_modules/ngx-moment/__ivy_ngcc__/fesm2015/ngx-moment.js 621:50-56
node_1  | "export 'locale' was not found in 'moment'
node_1  | ERROR in ./node_modules/ngx-moment/__ivy_ngcc__/fesm2015/ngx-moment.js 451:15-24
node_1  | "export 'parseZone' was not found in 'moment'
node_1  | ERROR in ./node_modules/ngx-moment/__ivy_ngcc__/fesm2015/ngx-moment.js 253:16-37
node_1  | "export 'relativeTimeThreshold' was not found in 'moment'
node_1  | ERROR in ./node_modules/ngx-moment/__ivy_ngcc__/fesm2015/ngx-moment.js 288:15-19
node_1  | "export 'unix' was not found in 'moment'
node_1  | ERROR in ./node_modules/ngx-moment/__ivy_ngcc__/fesm2015/ngx-moment.js 333:25-28
node_1  | "export 'utc' was not found in 'moment'
node_1  | ERROR in ./node_modules/ngx-moment/__ivy_ngcc__/fesm2015/ngx-moment.js 333:47-50
node_1  | "export 'utc' was not found in 'moment'
node_1  |     
node_1  |     ERROR in node_modules/ngx-moment/add.pipe.d.ts:2:25 - error TS2307: Cannot find module 'moment'.
node_1  |     
node_1  |     2 import * as moment from 'moment';
node_1  |                               ~~~~~~~~
node_1  |     node_modules/ngx-moment/calendar.pipe.d.ts:2:25 - error TS2307: Cannot find module 'moment'.
node_1  |     
node_1  |     2 import * as moment from 'moment';
node_1  |                               ~~~~~~~~
node_1  |     node_modules/ngx-moment/date-format.pipe.d.ts:2:25 - error TS2307: Cannot find module 'moment'.
node_1  |     
node_1  |     2 import * as moment from 'moment';
node_1  |                               ~~~~~~~~
node_1  |     node_modules/ngx-moment/difference.pipe.d.ts:2:25 - error TS2307: Cannot find module 'moment'.
node_1  |     
node_1  |     2 import * as moment from 'moment';
node_1  |                               ~~~~~~~~
node_1  |     node_modules/ngx-moment/parse.pipe.d.ts:2:25 - error TS2307: Cannot find module 'moment'.
node_1  |     
node_1  |     2 import * as moment from 'moment';
node_1  |                               ~~~~~~~~
node_1  |     node_modules/ngx-moment/subtract.pipe.d.ts:2:25 - error TS2307: Cannot find module 'moment'.
node_1  |     
node_1  |     2 import * as moment from 'moment';
node_1  |                               ~~~~~~~~
node_1  |     node_modules/ngx-moment/time-ago.pipe.d.ts:2:25 - error TS2307: Cannot find module 'moment'.
node_1  |     
node_1  |     2 import * as moment from 'moment';
node_1  |                               ~~~~~~~~
node_1  |     node_modules/ngx-moment/utc.pipe.d.ts:2:25 - error TS2307: Cannot find module 'moment'.
node_1  |     
node_1  |     2 import * as moment from 'moment';
node_1  |                               ~~~~~~~~
node_1  |     node_modules/ngx-moment/local.pipe.d.ts:2:25 - error TS2307: Cannot find module 'moment'.
node_1  |     
node_1  |     2 import * as moment from 'moment';
node_1  |                               ~~~~~~~~
node_1  |     node_modules/ngx-moment/locale.pipe.d.ts:2:25 - error TS2307: Cannot find module 'moment'.
node_1  |     
node_1  |     2 import * as moment from 'moment';
node_1  |                               ~~~~~~~~
node_1  |     node_modules/ngx-moment/parse-zone.pipe.d.ts:2:25 - error TS2307: Cannot find module 'moment'.
node_1  |     
node_1  |     2 import * as moment from 'moment';
node_1  |                               ~~~~~~~~
node_1  |     node_modules/ngx-moment/is-before.pipe.d.ts:1:25 - error TS2307: Cannot find module 'moment'.
node_1  |     
node_1  |     1 import * as moment from 'moment';
node_1  |                               ~~~~~~~~
node_1  |     node_modules/ngx-moment/is-after.pipe.d.ts:1:25 - error TS2307: Cannot find module 'moment'.
node_1  |     
node_1  |     1 import * as moment from 'moment';
node_1  |                               ~~~~~~~~

Ensure your issue is isolated to ngx-moment. Issues involving third party tools will be closed unless submitted by the tool's author/maintainer.

Environment:

Please answer the following questions:

  • Angular version?
    9.1.4
  • TypeScript version?
    3.8.3
  • moment version?
    2.25.0
  • Are you using moment-timezone?
    yes, version 0.5.28
  • Are you using the angular-cli?
    yes, version 9.1.4
  • Using Rollup/Webpack/System.js/Ionic/similar?
    n/a
@nickyg91
Copy link

nickyg91 commented May 1, 2020

Looks like this issue is actually caused by moment itself.
See moment/moment#5491

Digging into the source for this lib - it just pulls in the latest minor version of moment, meaning when it is installed it will currently pull the defective version of moment, which is 2.25.0.

@adamdport
Copy link

adamdport commented May 1, 2020

it looks like a fix has been released, but I imagine ngx-moment needs to upgrade their dependency to pull it in. Once that happens we should be good to go. moment is a peer dependency so installing 2.25.1 should fix it. ...doesn't seem to resolve it for me.

@nickyg91
Copy link

nickyg91 commented May 1, 2020

I had to npm cache clear --hard. If that doesn't work then try dumping the node_modules folder.

@mhosman
Copy link

mhosman commented May 1, 2020

Still not working with 2.25.1:

WARNING in ./node_modules/moment/src/lib/locale/locales.js
Module not found: Error: Can't resolve './locale' in 'D:\Desarrollo\SendGround\pwa\node_modules\moment\src\lib\locale'

ERROR in ./node_modules/ngx-moment/__ivy_ngcc__/fesm2015/ngx-moment.js 237:15-23
"export 'duration' was not found in 'moment'
ERROR in ./node_modules/ngx-moment/__ivy_ngcc__/fesm2015/ngx-moment.js 606:12-18
"export 'isDate' was not found in 'moment'
ERROR in ./node_modules/ngx-moment/__ivy_ngcc__/fesm2015/ngx-moment.js 68:52-60
"export 'isMoment' was not found in 'moment'
ERROR in ./node_modules/ngx-moment/__ivy_ngcc__/fesm2015/ngx-moment.js 609:17-25
"export 'isMoment' was not found in 'moment'
ERROR in ./node_modules/ngx-moment/__ivy_ngcc__/fesm2015/ngx-moment.js 621:15-23
"export 'isMoment' was not found in 'moment'
ERROR in ./node_modules/ngx-moment/__ivy_ngcc__/fesm2015/ngx-moment.js 621:50-56
"export 'locale' was not found in 'moment'
ERROR in ./node_modules/ngx-moment/__ivy_ngcc__/fesm2015/ngx-moment.js 451:15-24
"export 'parseZone' was not found in 'moment'
ERROR in ./node_modules/ngx-moment/__ivy_ngcc__/fesm2015/ngx-moment.js 253:16-37
"export 'relativeTimeThreshold' was not found in 'moment'
ERROR in ./node_modules/ngx-moment/__ivy_ngcc__/fesm2015/ngx-moment.js 288:15-19
"export 'unix' was not found in 'moment'
ERROR in ./node_modules/ngx-moment/__ivy_ngcc__/fesm2015/ngx-moment.js 333:25-28
"export 'utc' was not found in 'moment'
ERROR in ./node_modules/ngx-moment/__ivy_ngcc__/fesm2015/ngx-moment.js 333:47-50
"export 'utc' was not found in 'moment'

Also not working dumpling node_modules or running npm cache clear --hard

@nickyg91
Copy link

nickyg91 commented May 1, 2020

What does your package.json look like? A workaround I have tested is to just to use moment 2.24.0 alongside ngx-moment.

@mhosman
Copy link

mhosman commented May 1, 2020

@nickyg91 yes, it's working with 2.24.0. We are taking about >= 2.25.0

@nickyg91
Copy link

nickyg91 commented May 1, 2020

Right. As per the original issue on moment people are still confirming that the issue persists. If you need an immediate workaround you'd have to downgrade moment.

@ludufre
Copy link

ludufre commented May 2, 2020

Same problema here. Application with more than 2 thousands users along my country. I had to downgrade to version 2.24.

abdatta added a commit to abdatta/bulls-eye that referenced this issue May 2, 2020
@mhosman
Copy link

mhosman commented May 4, 2020

Fixed with moment version 2.25.3

@tarlepp
Copy link
Author

tarlepp commented May 4, 2020

hmm, don't see that yet in releases - https://github.com/moment/moment/releases

Just tried that 2.25.2 couple of hours ago and problem exists with that.

@mhosman
Copy link

mhosman commented May 4, 2020

hmm, don't see that yet in releases - https://github.com/moment/moment/releases

Just tried that 2.25.2 couple of hours ago and problem exists with that.

You need to go to this link: https://www.npmjs.com/package/moment

@tarlepp
Copy link
Author

tarlepp commented May 4, 2020

hmm, don't see that yet in releases - https://github.com/moment/moment/releases
Just tried that 2.25.2 couple of hours ago and problem exists with that.

You need to go to this link: https://www.npmjs.com/package/moment

I always check GitHub releases first - which should be the same as npm - or any other package manager.

Just because usually things like update some package manager is done via CI which triggers on those GitHub tags - or that is what I've used and seen used in multiple different project.

@nickyg91
Copy link

nickyg91 commented May 4, 2020

Looking at other issues on moment - it looks like this is potentially fixed in 2.25.3? Again - if you are blocked and 2.25.3 does not fix your issue just install 2.24.0 alongside ngx-moment for the workaround.

@mhosman
Copy link

mhosman commented May 4, 2020

Yes, fixed with moment v.2.25.3. You can close the issue.

@ruspaull
Copy link

ruspaull commented May 5, 2020

v2.25.3 Fixed it for me

@tarlepp
Copy link
Author

tarlepp commented May 5, 2020

Yeah, I can also confirm that 2.25.3 fixed this issue, closing this one.

@tarlepp tarlepp closed this as completed May 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants