Could not find include include file

For me I had to set root parameter,

ejs.render(
  html,
  {},
  {
    root: process.cwd(),
  }
)

And then use it like,

<%- include('/footer/index.ejs'); %>

Include paths are relative, you will need to update your paths to include the "partials" subfolder e.g.

<% include partials/header %>
<h1>welcome</h1>
<% include partials/footer %>

See the docs


Try any of these:

<% include header.ejs %>
<% include header %>
<%- include('header.ejs'); -%>
<%- include('./header.ejs'); -%>