GET / 500 1.492 ms – 1426
SyntaxError: Unexpected identifier in /*/index.ejs while compiling ejs
If the above error is not helpful, you may want to try EJS-Lint:
https://github.com/RyanZim/EJS-Lint
Or, if you meant to create an async function, pass `async: true` as an option.
includeの有無でエラーが生じるので色々試したところ、エラーが消えました。
## before
<% include header.ejs %>
<h1>Posts</h1>
<ul>
<% for (var i=0; i<posts.length; i++) { %>
<li>
<a href="/posts/<%= i %>"><%= posts[i].title %></a>
</li>
<% } %>
</ul>
<% include footer.ejs %>
## after
<% include('header.ejs') %>
<h1>Posts</h1>
<ul>
<% for (var i=0; i<posts.length; i++) { %>
<li>
<a href="/posts/<%= i %>"><%= posts[i].title %></a>
</li>
<% } %>
</ul>
<% include('footer.ejs') %>
ページ数が増えれば増えるほど、includeを使わない手はないので、includeでエラーがあるとドキッとします。