moment: Getting webpack error after update to 2.19.0
Don’t know if it is related to #4216 because I’m using Angular 4.4.4
and that is a React
issue, so I’m posting this as a separate issue.
I got the following error after the update:
__WEBPACK_IMPORTED_MODULE_2_moment__ is not a function
I’m using the following moment
packages
"moment": "2.19.0",
"@types/moment": "2.13.0",
The code where I get the error is quite simple:
import * as moment from 'moment';
...
if (moment().year() !== this.mainData.activeYear)
...
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 45
- Comments: 23 (3 by maintainers)
Same here. Not using Angular or React. This is my webpack error:
+1 - Same issue with Angular 4
This version ( 2.19.0 must be fixed ) for the ‘moment’ ahahah, install the 2.18.1 “moment”: “~2.18.1”
react webpack error
Same issue here 😢 We’ll downgrade back to 2.18 until this is resolved.
same problem when moment upgrade to version 2.19.0
WARNING in ./~/_moment@2.19.0@moment/src/lib/locale/locales.js Module not found: Error: Can't resolve './locale' in '/Users/XXX/code/gitlab/web-editor/node_modules/moment@2.19.0@moment/src/lib/locale' @ ./~/_moment@2.19.0@moment/src/lib/locale/locales.js 65:16-60 @ ./~/_moment@2.19.0@moment/src/lib/locale/locale.js @ ./~/_moment@2.19.0@moment/src/moment.js @ ./~/_antd@2.9.2@antd/lib/calendar/index.js @ ./~/_antd@2.9.2@antd/lib/index.js @ dll lib
Same problem with vuejs and webpack.
Downgraded to
~2.18.0
which circumvents this for the time being.