rniemeyer / knockout-jqAutocomplete

knockout-jqAutocomplete is a Knockout.js plugin designed to work with jQuery UI's autocomplete widget.
MIT License
49 stars 20 forks source link

TypeError: Unable to process binding "jqAuto.. #2

Closed gaydenko closed 10 years ago

gaydenko commented 10 years ago

Hi! Under AMD (with r.js optimizing) all does work. Now I'm migrating to CJS-like environment (guided by webpack), and have got the error:

Uncaught TypeError: Unable to process binding "jqAuto: function (){return { 
                       value:placeTry,source:getAoids,dataValue:placeData,labelProp:"label",valueProp:"value",options:{minLength:1,delay:200}} }"
Message: object is not a function a4.min.js:17352
init a4.min.js:17352
(anonymous function) a4.min.js:12840
ko.dependencyDetection.ignore a4.min.js:11333
(anonymous function) a4.min.js:12839
ko.utils.arrayForEach a4.min.js:10355
applyBindingsToNodeInternal a4.min.js:12825
applyBindingsToNodeAndDescendantsInternal a4.min.js:12700
applyBindingsToDescendantsInternal a4.min.js:12682
applyBindingsToNodeAndDescendantsInternal a4.min.js:12709
applyBindingsToDescendantsInternal a4.min.js:12682
applyBindingsToNodeAndDescendantsInternal a4.min.js:12709
applyBindingsToDescendantsInternal a4.min.js:12682
applyBindingsToNodeAndDescendantsInternal a4.min.js:12709
applyBindingsToDescendantsInternal a4.min.js:12682
applyBindingsToNodeAndDescendantsInternal a4.min.js:12709
applyBindingsToDescendantsInternal a4.min.js:12682
applyBindingsToNodeAndDescendantsInternal a4.min.js:12709
ko.applyBindings
...

Chrome debugger stops at

var widget = $(element).autocomplete(config).data("ui-autocomplete");

All other things in a project does work including ko itself, binding to jquery datepicker and knockout.punches. My koSetup.js file starts with

'use strict';
require('jquery');
require('jquery.ui');
var ko = require('knockout');
require('knockout.punches');
require('knockout-jqAutocomplete');

ko.punches.interpolationMarkup.enable();
...

I'm new on the client side and can miss something obvious:)

rniemeyer commented 10 years ago

@gaydenko hello! I would love to try to be able to reproduce this and help you out. Is there a way that you send me a sample project or something (rniemeyer at gmail)?

gaydenko commented 10 years ago

There is a deep deps tree in a project, so I need some time to extract an example. Just for record, this is a stack with generated source maps. At knockout-jqAutocomplete.js*:65 jquery is just an empty object.

Uncaught TypeError: Unable to process binding "jqAuto: function (){return { 
                       value:placeTry,source:getAoids,dataValue:placeData,labelProp:"label",valueProp:"value",options:{minLength:1,delay:200}} }"
Message: object is not a function knockout-jqAutocomplete.js*:65
init knockout-jqAutocomplete.js*:65
(anonymous function) knockout.js*:2586
ko.dependencyDetection.ignore knockout.js*:1079
(anonymous function) knockout.js*:2585
ko.utils.arrayForEach knockout.js*:101
applyBindingsToNodeInternal knockout.js*:2571
applyBindingsToNodeAndDescendantsInternal knockout.js*:2446
applyBindingsToDescendantsInternal knockout.js*:2428
applyBindingsToNodeAndDescendantsInternal knockout.js*:2455
applyBindingsToDescendantsInternal knockout.js*:2428
applyBindingsToNodeAndDescendantsInternal knockout.js*:2455
applyBindingsToDescendantsInternal knockout.js*:2428
applyBindingsToNodeAndDescendantsInternal knockout.js*:2455
applyBindingsToDescendantsInternal knockout.js*:2428
applyBindingsToNodeAndDescendantsInternal knockout.js*:2455
applyBindingsToDescendantsInternal knockout.js*:2428
applyBindingsToNodeAndDescendantsInternal knockout.js*:2455
ko.applyBindings knockout.js*:2657
api.render View.js*:37
(anonymous function) Posters.js:85
doJob Ctrl.js*:102
sb.emit.next Ctrl.js*:111
(anonymous function) Sandbox.js*:64
(anonymous function)
gaydenko commented 10 years ago

@rniemeyer It's here: http://gaydenko.com/tmp/jqa01.tar.bz2 result.js used in index.html is a result of running webpack (installable with npm) in the directory.

gaydenko commented 10 years ago

@rniemeyer, webpack's author has helped ot resolve the issue with additional configuration option. So, closing the issue. Sorry for noise and thanks for the jqAuto!

rniemeyer commented 10 years ago

@gaydenko - glad to hear that you got it sorted out

egucciar commented 8 years ago

If the problem is solved you should have pasted the solution so future users of webpack + this package would know what to do - but i will keep searching

@gaydenko

gregveres commented 6 years ago

@gaydenko did you get this working? I am trying to include this in a webpack and I am getting that it can't resolve jquery-ui/automcomplete. I was wondering how you got around that? I have jquery-ui installed, but webpack doesn't seem to be able to make the leap to only look at /autocomplete