Title: __WEBPACK_IMPORTED_MODULE_4_moment__ is not a function when trying to use moment.js with typings · Issue #1974 · angular/angular-cli · GitHub
Open Graph Title: __WEBPACK_IMPORTED_MODULE_4_moment__ is not a function when trying to use moment.js with typings · Issue #1974 · angular/angular-cli
X Title: __WEBPACK_IMPORTED_MODULE_4_moment__ is not a function when trying to use moment.js with typings · Issue #1974 · angular/angular-cli
Description: Please provide us with the following information: OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?) Ubuntu 14.04 Versions. Please run ng --version. If there's nothing outputted, please run in a Terminal:...
Open Graph Description: Please provide us with the following information: OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?) Ubuntu 14.04 Versions. Please run ng --version. If there's noth...
X Description: Please provide us with the following information: OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?) Ubuntu 14.04 Versions. Please run ng --version. If there's ...
Opengraph URL: https://github.com/angular/angular-cli/issues/1974
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"__WEBPACK_IMPORTED_MODULE_4_moment__ is not a function when trying to use moment.js with typings","articleBody":"> ## Please provide us with the following information:\n1. OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)\n Ubuntu 14.04\n2. Versions. Please run `ng --version`. If there's nothing outputted, please run\n in a Terminal: `node --version` and paste the result here:\n\n```\nangular-cli: 1.0.0-beta.11-webpack.8\nnode: 6.3.1\nos: linux x64\n```\n1. Repro steps. Was this an app that wasn't created using the CLI? What change did you\n do on your code? etc.\n This is a project done from the start with angular cli.\n\n1) Install moment:\n\n```\nnpm install moment --save\ntypings install dt~moment --global --save\n```\n\n2)\nInclude in ts file:\n`import * as moment from 'moment'`\nand call any method:\n`moment().calendar()`\n1. The log given by the failure. Normally this include a stack trace and some\n more information.\n\n```\noffers.service.ts:21 __WEBPACK_IMPORTED_MODULE_4_moment__ is not a function\nOffersService.handleError @ offers.service.ts:21\nZoneDelegate.invoke @ zone.js:323\nNgZoneImpl.inner.inner.fork.onInvoke @ ng_zone_impl.js:53\nZoneDelegate.invoke @ zone.js:322\nZone.run @ zone.js:216\n(anonymous function) @ zone.js:571\nZoneDelegate.invokeTask @ zone.js:356\nNgZoneImpl.inner.inner.fork.onInvokeTask @ ng_zone_impl.js:44\nZoneDelegate.invokeTask @ zone.js:355\nZone.runTask @ zone.js:256\ndrainMicroTaskQueue @ zone.js:474\nZoneTask.invoke @ zone.js:426\n```\n1. Mention any other details that might be useful.\n\nIf I leave `import * as moment from 'moment'` in the component, the component wont run at all. If I remove it, the component works properly but I get `client?93b6:49 [default] /home/alejo/projects/ng-backend/src/app/services/offers/offers.service.ts:37:31 \nCannot find name 'moment'.` when serving the app.\n\n> ---\n> \n> Thanks! We'll be in touch soon.\n","author":{"url":"https://github.com/alejoar","@type":"Person","name":"alejoar"},"datePublished":"2016-09-04T23:44:50Z","url":"https://github.com/angular/angular-cli/issues/1974"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e991f131-14b6-bfce-3451-f18154219c29 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D322:20AA01:480346B:5B42315:6B022F67 |
| html-safe-nonce | e8b4aa9915e513c3e3415a483944c4342abf7d33a0f316a70f3326409b5b86fa |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMzIyOjIwQUEwMTo0ODAzNDZCOjVCNDIzMTU6NkIwMjJGNjciLCJ2aXNpdG9yX2lkIjoiNDE2MjE2MjE3NTk0OTAyNTEyNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 4462bd13e26aadb421042309ba5c6b724e53e07aef722b8ccd47be7711b5e705 |
| hovercard-subject-tag | issue:174976123 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular-cli/1974/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5e3f143fc800dc3f4769020152f391473ade87d3bda0678bf64deac578d3dad0/angular/angular-cli/issues/1974 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5e3f143fc800dc3f4769020152f391473ade87d3bda0678bf64deac578d3dad0/angular/angular-cli/issues/1974 |
| og:image:alt | Please provide us with the following information: OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?) Ubuntu 14.04 Versions. Please run ng --version. If there's noth... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | alejoar |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular-cli git https://github.com/angular/angular-cli.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 36891867 |
| octolytics-dimension-repository_nwo | angular/angular-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 36891867 |
| octolytics-dimension-repository_network_root_nwo | angular/angular-cli |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width