title: Rails Uncaught SyntaxError: Unexpected token <
body: <p>I am getting an <code>Uncaught SyntaxError: Unexpected token &lt;</code> error on a partial render through js. The partial only contains a table.</p>
  
  <p>The partial is being called but the error message in the browser console is showing the first <code>&lt;</code> of the table tag as the unexpected token.</p>
  
  <pre><code>&lt;table class='table table-sm'&gt; # &lt;- this line errors
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th&gt;Part #&lt;/th&gt;
        &lt;th&gt;Description&lt;/th&gt;
        &lt;th&gt;Qty&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td&gt;SCS-#10-24X.375-BLK&lt;/td&gt;
        &lt;td&gt;Countersunk screw, #10-24 X .375, Black oxide&lt;/td&gt;
        &lt;td&gt;2.0&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>_check_it.html.haml</p>
  
  <pre><code>- if @part.part_structures == 0
    No components
  - else
    %table.table.table-sm
      %thead
        %tr
          %th Part #
          %th Description
          %th Qty
      %tbody
        - @part.part_structures.each do |ps|
          %tr
          %td= ps.component.partNo
          %td= ps.component.description
          %td= ps.qty
  </code></pre>
  
  <p>check_it.js.erb</p>
  
  <pre><code>$("#that_one").replace("&lt;%= j render(partial: 'check_it') %&gt;");
  </code></pre>
  
  <p>parts_controller.rb</p>
  
  <pre><code>def check_it
    respond_to do |format|
      format.js {render partial: 'check_it', :content_type =&gt; 'text/html', part: @part}
    end
  end
  </code></pre>
  
  <p>Why would the partial error out in the JS console for the beginning of the table tag?</p>