Problem with Select2 on FTP server

Hi, i’m using the Select2 widget by Kartik-v inside a DynamicForm (using wbraganca widget as well) and having some issues. Everything works fine when i work on the project in my localhost, but when i try to upload it to the FTP server and access from there, I get an error on Select2. Specifically, when i press the “add” button a new Select2 widget is created, but the created input doesn’t load at all (the loading indicator appears but it never goes away). This issue happened before but i solved it by applying the changes this post suggested, at least when i was working on my locahost environment but it appeared again in the FTP server after uploading the project there.

In console it shows me the error “Uncaught ReferenceError: initSelect2Loading is not defined”. Not really sure why is it giving me the same error again. This doesn’t happen when i access the project via locahost.

Any help would be greatly appreciated, thanks in advance.