LeaVerou / awesomplete

Ultra lightweight, usable, beautiful autocomplete with zero dependencies.
http://leaverou.github.io/awesomplete/
MIT License
6.97k stars 611 forks source link

Does not work with script loaders #17164

Open drnkwati opened 6 years ago

drnkwati commented 6 years ago

This error is thrown in console when using a script loader ReferenceError: Awesomplete is not defined

LeaVerou commented 6 years ago

Which line throws the error? I suspect it's possible that the error may be thrown from your code using Awesomplete before it's loaded, than from Awesomplete itself.

drnkwati commented 6 years ago

From my console here are the lines from 10 in awesomplete.js: ` var _ = function (input, o) { var me = this;

// Keep track of number of instances for unique IDs
Awesomplete.count = (Awesomplete.count || 0) + 1;
this.count = Awesomplete.count;

// Setup`

However i noticed this behavior When i use the unminified version awesomplete.js everything works fine, but when i use the minified version awesomplete.min.js i get errors.

LeaVerou commented 6 years ago

That's very weird. Which script loader are you using? Any chance you could put up a reduced testcase somewhere?

Amaimersion commented 5 years ago

Same for me. I'm using webpack dynamic import(). For minified version it is not working, but for unminified everything is working fine.