Uncaught TypeError: $s2.select2 is not a function
<p>I'm using symfony2 and trying to work with tetranz/select2entity-bundle.</p>

<p>my layout.html.twig:</p>

<pre><code>'@SBCPlatformBundle/Resources/public/jquery/dist/jquery.min.js'         
            '@SBCPlatformBundle/Resources/public/bootstrap/dist/js/bootstrap.min.js'
            '@TetranzSelect2EntityBundle/Resources/public/js/select2entity.js'
</code></pre>

<p>and my XXXType (Form) :</p>

<pre><code> -&gt;add('fournisseur', Select2EntityType::class, [
        'multiple' =&gt; false,
        'remote_route' =&gt; 'fournisseur_home',
        'class' =&gt; 'SBCPlatformBundle:fournisseur',
        'primary_key' =&gt; 'id',
        'text_property' =&gt; 'name',
        'minimum_input_length' =&gt; 2,
        'page_limit' =&gt; 10,
        'allow_clear' =&gt; true,
        'delay' =&gt; 250,
        'cache' =&gt; true,
        'cache_timeout' =&gt; 60000, // if 'cache' is true
        'language' =&gt; 'fr',
        'placeholder' =&gt; 'Choisir ...',
    ])
</code></pre>

<p>So i had this error :</p>

<pre><code>main_select2entity_3.js:10 Uncaught TypeError: $s2.select2 is not a function
at HTMLSelectElement.&lt;anonymous&gt; (http://localhost/SBC/web/js/compiled/main_select2entity_3.js:10:13)
at Function.each (http://localhost/SBC/web/js/compiled/main_jquery.min_1.js:2:2861)
at n.fn.init.each (http://localhost/SBC/web/js/compiled/main_jquery.min_1.js:2:845)
at n.fn.init.$.fn.select2entity (http://localhost/SBC/web/js/compiled/main_select2entity_3.js:2:10)
at HTMLDocument.&lt;anonymous&gt; (http://localhost/SBC/web/js/compiled/main_select2entity_3.js:85:48)
at i (http://localhost/SBC/web/js/compiled/main_jquery.min_1.js:2:27151)
at Object.fireWith [as resolveWith] (http://localhost/SBC/web/js/compiled/main_jquery.min_1.js:2:27914)
at Function.ready (http://localhost/SBC/web/js/compiled/main_jquery.min_1.js:2:29707)
at HTMLDocument.J (http://localhost/SBC/web/js/compiled/main_jquery.min_1.js:2:29892)(anonymous function) @ main_select2entity_3.js:10each @ main_jquery.min_1.js:2each @ main_jquery.min_1.js:2$.fn.select2entity @ main_select2entity_3.js:2(anonymous function) @ main_select2entity_3.js:85i @ main_jquery.min_1.js:2fireWith @ main_jquery.min_1.js:2ready @ main_jquery.min_1.js:2J @ main_jquery.min_1.js:2
</code></pre>

<p>so any one can help to resolve this problem?</p>