Primefaces is not defined - JavaScript error
<p>I'm using Primefaces 5.3 with bootsfaces for my web layer. The problem I have is that I get the error "Primefaces is not defined" in a facelet where I use the component <strong>poll</strong> like this:</p>

<pre><code>&lt;b:row id="results"&gt;
   &lt;c:if test="${not empty twitterSearch.text or not empty twitterSearch.result }"&gt;
       &lt;b:panel  title="Tweets for #{twitterSearch.text}" collapsible="false" look="info" col-md="6"&gt;
         &lt;h:form&gt;
            &lt;p:poll interval="3" update="sentimentChart"  /&gt;
            &lt;p:chart id="sentimentChart" type="pie" model="#{liveSentimentChartBean.liveCharts.get(twitterSearch.text)}" style="width:400px;height:300px"/&gt;
         &lt;/h:form&gt;
       &lt;/b:panel&gt;
   &lt;/c:if&gt;
&lt;/b:row&gt;
</code></pre>

<p>This facelet called analysis.xhtml is a facelet client of the app_template.xhtml template and therefore its root element is as follows:</p>

<pre><code>&lt;ui:composition xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
                xmlns:b="http://bootsfaces.net/ui"
                template="/WEB-INF/templates/app_template.xhtml"
                xmlns:h="http://xmlns.jcp.org/jsf/html"
                xmlns:f="http://xmlns.jcp.org/jsf/core"
                xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
                xmlns:p="http://primefaces.org/ui"&gt;
</code></pre>

<p>I know the problem is usually due a missing the <strong>h:head</strong> label in the facelet, but this is defined in the template like this:</p>

<pre><code>&lt;?xml version='1.0' encoding='UTF-8' ?&gt; 
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:b="http://bootsfaces.net/ui"
      xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"&gt;

    &lt;h:head&gt;
        &lt;meta charset="utf-8" /&gt;
        &lt;title&gt;#{i18n['page.title']}&lt;/title&gt;
        &lt;meta name="viewport" content="width=device-width, initial-scale=1"/&gt;
        &lt;meta name="revisit-after" content="7 days" /&gt;
        &lt;meta name="DISTRIBUTION" content="GLOBAL" /&gt;
        &lt;meta http-equiv="PRAGMA" content="NO-CACHE" /&gt;
    &lt;/h:head&gt;

    &lt;h:body&gt;
        &lt;c:set var="root" value="#{request.contextPath}/" /&gt;
        &lt;ui:insert name="navbar"&gt;
            &lt;ui:include src="/WEB-INF/content/navbar.xhtml"/&gt;
        &lt;/ui:insert&gt;
        &lt;b:container&gt;
            &lt;ui:insert name="content" /&gt;
        &lt;/b:container&gt;
        &lt;ui:insert name="footer"&gt;
            &lt;ui:remove&gt;
                &lt;ui:include src="/WEB-INF/content/footer.xhtml"/&gt;
            &lt;/ui:remove&gt;
        &lt;/ui:insert&gt;
    &lt;/h:body&gt;
&lt;/html&gt;
</code></pre>

<p><a href="https://i.stack.imgur.com/M0NBe.png" rel="nofollow"><img src="https://i.stack.imgur.com/M0NBe.png" alt="enter image description here"></a></p>

<p>Does anyone know the problem may be due? Thanks in advance :)</p>