I am getting the following error and I can't figure out how to fix it. I've been more of a traditional JS developer and have been focusing exclusively on the backend lately.
I tried to manually load the specific JS file but it isn't working. I am still getting an error.
Current error is:
aurelia-logging-console.js:54 ERROR [templating-resources] TypeError: $(...).pickadate is not a function
at HTMLDocument.eval (c-field-date.js:80)
at fire (jquery.js:3187)
at Object.add [as done] (jquery.js:3246)
at jQuery.fn.init.jQuery.fn.ready (jquery.js:3496)
at InputDate._attachPlugin (c-field-date.js:78)
at InputDate.attached (c-field-date.js:51)
at Controller.attached (aurelia-templating.js:3513)
at View.attached (aurelia-templating.js:1558)
at ViewSlot.add (aurelia-templating.js:1726)
at eval (aurelia-templating.js:4534)
The hack I tried is as below, but it still fails:
$.getScript("/libs/pickadate.js-3.5.6/lib/picker.js", function(){
//alert("Script loaded and executed.");
// here you can use anything you defined in the loaded script
});
I heard someone mention that we may have a bug with JQuery being loaded twice but I'm not sure how to debug that.
The project is using jspm
and npm
.
Any ideas how to debug and/or fix this?
Note: This is not a duplicate. The other question does not relate to the error "pickadate is not a function"
The problem was that JQuery was being loaded twice. Removing the duplicate solved the problem.