resolved __WEBPACK_IMPORTED_MODULE_ moment__ is not a function
Issue with Moment.js with webpack on PC Win 7. All was fine on my Mac but when I updated on PC Webpack complained at run time with an error that moment was not a function. I was able to resolve on my PC using import * as moment from 'moment/moment.js'; It was a last hack attempt but it worked for me.
Ran simple test in constructor: const today: string = moment().format('D MMM YYYY'); console.log ('today?', today);
The Angular cli will compile fine but when you visit your website it will fail with webpack error. I also went back a version to 1.4.4 and up to the latest CLI beta and it did not resolve the issue. Just wanted to report that this worked for me. I hope it helps.
@angular/cli: 1.4.5 node: 8.1.4 os: win32 x64 @angular/animations: 4.4.4 @angular/cdk: 2.0.0-beta.12 @angular/common: 4.4.4 @angular/compiler: 4.4.4 @angular/core: 4.4.4 @angular/forms: 4.4.4 @angular/http: 4.4.4 @angular/material: 2.0.0-beta.12 @angular/platform-browser: 4.4.4 @angular/platform-browser-dynamic: 4.4.4 @angular/router: 4.4.4 @angular/cli: 1.4.5 @angular/compiler-cli: 4.4.4 @angular/language-service: 4.4.4 typescript: 2.3.4
WEBPACK_IMPORTED_MODULE_0_moment is not a function I got this issue too, have you had solution yet?
Heya, this sounds odd and I'd like to investigate it.
Can you setup a minimal repro please? You can read here why this is needed. A good way to make a minimal repro is to create a new app via ng new repro-app and adding the minimum possible code to show the problem. Then you can push this repository to github and link it here.
Hi, same here: ERROR TypeError: WEBPACK_IMPORTED_MODULE_4_moment is not a function
I got a different error related to moment.js. This issue indicates that going back to moment version 2.18.0, instead of 2.19.0, is a solution. https://github.com/moment/moment/issues/2979
i degraded to moment 2.18.0 and it fixed
moment 2.19.1 fixes the broken 2.19.0 version
Upgrading to 2.19.1 fixes the issue for me
Upgrading to 2.19.1 fixes the issue for me too. Thanks everybody
I'm sorry, but this issue is not caused by Angular CLI. Please contact the author(s) of the moment project or file an issue on their issue tracker.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.