zestia / ember-select-box

:capital_abcd: A faux select box for Ember apps
MIT License
64 stars 14 forks source link

Error in fastboot #12

Closed wuron closed 5 years ago

wuron commented 7 years ago

I'm getting following error in console when running app with fastboot.

There was an error running your app in fastboot. More info about the error:
 TypeError: Cannot read property 'trim' of undefined
...
ember-select-box/mixins/select-box/select-box/searchable.js:13:1

Looks like the addon is trying to get jQuery.trim but jQuery is unavailable in fastboot mode.

amk221 commented 7 years ago

I can fix that specific error, but phasing out jQuery altogether is a bit more challenging

amk221 commented 7 years ago

I've removed use of jQuery's trim in 1.2.1, let me know if that helps. (Although, I presume you'll just get warnings about other uses of jQuery?)

wuron commented 7 years ago

Yeah, now I'm getting warning about contains in ember-select-box/mixins/select-box/general/click-outside.js:9:1.

wuron commented 7 years ago

Looks like in some places it can be easily fixed, just like with trim, but in other places where addon uses event listeners, there should be a check for fastboot. Something like in ember-simple-auth or other addons: https://github.com/simplabs/ember-simple-auth/blob/master/addon/mixins/authenticated-route-mixin.js#L38

amk221 commented 7 years ago

Yeh, bare with me - I'll see if I can do it today

amk221 commented 7 years ago

I've made headway removing reliance on jQuery, but come across a blocker for now https://github.com/emberjs/ember.js/issues/15578