awesomplete icon indicating copy to clipboard operation
awesomplete copied to clipboard

Does not work with script loaders

Open drnkwati opened this issue 7 years ago • 4 comments
trafficstars

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

drnkwati avatar Nov 07 '18 05:11 drnkwati

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.

LeaVerou avatar Nov 07 '18 17:11 LeaVerou

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.

drnkwati avatar Nov 07 '18 18:11 drnkwati

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

LeaVerou avatar Nov 07 '18 19:11 LeaVerou

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

Amaimersion avatar Jul 30 '19 17:07 Amaimersion