title: Cannot read property 'querySelectorAll' of null bootstrap collapse
body: <p>I am writing php code for bootstrap collapse and taking error Cannot read property 'querySelectorAll' of null. I spend really a lot of time to this simple problem. If I put without php that is working really norm without error
  Error is:</p>
  
  <pre><code>Uncaught TypeError: Cannot read property 'querySelectorAll' of null
  at a.t._getParent (collapse.js:300)
  at new a (collapse.js:88)
  at HTMLDivElement.&lt;anonymous&gt; (collapse.js:345)
  at Function.each (jquery.js:368)
  at jQuery.fn.init.each (jquery.js:157)
  at jQuery.fn.init.a._jQueryInterface [as collapse] (collapse.js:331)
  at HTMLDivElement.&lt;anonymous&gt; (collapse.js:378)
  at Function.each (jquery.js:368)
  at jQuery.fn.init.each (jquery.js:157)
  at HTMLButtonElement.&lt;anonymous&gt; (collapse.js:374)
  </code></pre>
  
  <p>That is my php code</p>
  
  <pre><code>&lt;div id="info-content" class="accordion" id="accordionExample"&gt;
                    &lt;?
                      $faqs = get_field('faqs');
                      foreach ($faqs as $key =&gt; $value):
                    ?&gt;
                    &lt;div class="card"&gt;
                      &lt;div class="card-header" id="headingOne&lt;?=$key;?&gt;"&gt;
                        &lt;h5 class="mb-0"&gt;
                          &lt;button class="btn btn-link" type="button" data-toggle="collapse" data-target="#collapseOne&lt;?=$key;?&gt;" aria-expanded="true" aria-controls="collapseOne&lt;?=$key;?&gt;"&gt;
                            &lt;?=$value['question'];?&gt;
                          &lt;/button&gt;
                        &lt;/h5&gt;
                        &lt;i class="fas fa-plus"&gt;&lt;/i&gt;
                      &lt;/div&gt;
                      &lt;div id="collapseOne&lt;?=$key;?&gt;" class="collapse &lt;?if($key==0):?&gt;show&lt;?endif;?&gt;" aria-labelledby="headingOne&lt;?=$key;?&gt;" data-parent="#accordionExample"&gt;
                        &lt;div class="card-body"&gt;
                          &lt;?=$value['answer'];?&gt;
                        &lt;/div&gt;
                      &lt;/div&gt;
                    &lt;/div&gt;
                    &lt;?endforeach;?&gt;
                  &lt;/div&gt;
  </code></pre>