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.

moment is not defined

See original GitHub issue

I followed the steps here: https://www.npmjs.com/package/bower-webpack-plugin And I run bower install angular-material-datetimepicker Add require("momentjs"); require("angular-material-datetimepicker"); in entry.js run webpack -d --watch everything is fine. But when I open index.html in the browser, it said Uncaught ReferenceError: moment is not defined I try the bootstrap demo in the example. It’s works fine. I don’t know if I forgot anything else or if there is a bug in angular-material-datetimepicker? Thanks for help!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

32reactions
bennekroufcommented, Jun 15, 2016

I managed the issue by adding in web pack conf

plugins: [
new webpack.ProvidePlugin({
      moment: "moment"
    })
....
13reactions
liu-kanghuicommented, Apr 11, 2016

I ran into the same probelm

I solved it by adding this line in my index.html file <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.6/moment-with-locales.min.js"></script>

Read more comments on GitHub >

github_iconTop Results From Across the Web

"moment is not defined" using moment.js - javascript
it returns " moment not defined. " referring to .format("dddd, MMMM Do YYYY, h:mm:ss p");. I've read the documentation, and everything looks ...
Read more >
ReferenceError: moment is not defined in JavaScript
To solve the "ReferenceError: moment is not defined" error in Node.js, make sure to install and import the moment package before using it....
Read more >
"Uncaught ReferenceError: moment is not defined" using ...
I installed Moment. js using npm: npm install moment . I'd now like to compile it using npm run dev to replace a...
Read more >
ReferenceError: moment is not defined · Issue #4572
I've use the latest version of moment js and include the minified js at the top of my script. Most of the time...
Read more >
Uncaught ReferenceError: moment is not defined
Hi, my personal blog is using the "zen" theme for quite some time now, but as it is hosted in Germany I now...
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