bendavis78 / paper-date-picker

Material design date picker component for polymer
http://bendavis78.github.io/paper-date-picker/
MIT License
225 stars 132 forks source link

Uncaught ReferenceError: moment is not defined #179

Closed atifwaqar closed 7 years ago

atifwaqar commented 7 years ago

Hi, I get the 3 exceptions/errors in Chrome Console when I import your HTML like this

<link rel="import" href="/sys/paper-date-picker/paper-date-picker.html">

image

and when I remove the import code my page works fine: image

Any idea what am I doing wrong here?

web-padawan commented 7 years ago

Ensure that moment-element and corresponding moment library are installed in your sys directory.

atifwaqar commented 7 years ago

@web-padawan I have the moment-element. image

Is there anything else needed?

web-padawan commented 7 years ago

As you can see here, moment-element requires moment library as a dependency (in fact, it only provides an HTML import for moment which should be also installed). You are missing it, but I have no idea why. Are you copying dependencies manually instead of running bower install?

atifwaqar commented 7 years ago

Yes, I'm copying dependencies manually. The platform that I'm using, does not allow me to run bower install , if I do, it messes a lot of things. :(

admwx7 commented 7 years ago

All polymer elements rely on a flat peer-dependency structure, which means that if you look at the folder our element sits in then go up one directory you should have a folder at that level named moment-element which as a moment-element.html file within it, which imports based on ../moment/moment.html (another sibling folder under /sys/ for you).

This isn't any sort of issue we can do anything about our on part unfortunately, my recommendation is to fix your build environment, if the above doesn't solve your problem and you're still having issues, just send me an email.