<script> window.data = <%- JSON.stringify(data) -%> </script> <%- include('header') -%> <div id="root"><%- content -%></div> <%- include('footer') -%> This throws an error saying unexpected end of input in the script tag. This is running on the server side and both data and content is provided by the render call.