Could not include another file in nodejs(include(‘/partials/headerindex’, { pageTitle: ‘Home’, showSidebar: false, barname:‘user’ }) %>)

Hi,

The web services are flawa-test and flawa, deployment is now successful, but i am still getting error.

I changed from npm to yarn and the app is running on console but the site is throwing error as “Internal Server Error”

The app is working locally, however, on render console i saw the below exception throw:

==> Starting service with ‘node app.js’
Sep 14 08:40:06 AM Warning: connect.session() MemoryStore is not
Sep 14 08:40:06 AM designed for a production environment, as it will leak
Sep 14 08:40:06 AM memory, and will not scale past a single process.
Sep 14 08:40:06 AM Server is running on port 10000
Sep 14 08:40:10 AM Error: /opt/render/project/src/views/pages/index.ejs:1
Sep 14 08:40:10 AM >> 1| <%- include(‘/partials/headerindex’, { pageTitle: ‘Home’, showSidebar: false, barname:‘user’ }) %>
Sep 14 08:40:10 AM 2|
Sep 14 08:40:10 AM 3|
Sep 14 08:40:10 AM 4|
Sep 14 08:40:10 AM
Sep 14 08:40:10 AM ENOENT: no such file or directory, open ‘/opt/render/project/src/views/partials/headerindex.ejs’
Sep 14 08:40:10 AM at Object.openSync (node:fs:601:3)
Sep 14 08:40:10 AM at Object.readFileSync [as fileLoader] (node:fs:469:35)
Sep 14 08:40:10 AM at fileLoader (/opt/render/project/src/node_modules/ejs/lib/ejs.js:293:18)
Sep 14 08:40:10 AM at handleCache (/opt/render/project/src/node_modules/ejs/lib/ejs.js:224:18)
Sep 14 08:40:10 AM at includeFile (/opt/render/project/src/node_modules/ejs/lib/ejs.js:323:10)
Sep 14 08:40:10 AM at include (/opt/render/project/src/node_modules/ejs/lib/ejs.js:701:16)
Sep 14 08:40:10 AM at eval (“/opt/render/project/src/views/pages/index.ejs”:10:17)
Sep 14 08:40:10 AM at index (/opt/render/project/src/node_modules/ejs/lib/ejs.js:703:17)
Sep 14 08:40:10 AM at tryHandleCache (/opt/render/project/src/node_modules/ejs/lib/ejs.js:274:36)
Sep 14 08:40:10 AM at exports.renderFile [as engine] (/opt/render/project/src/node_modules/ejs/lib/ejs.js:491:10)

The below setting is working fine locally but causing errors on render:
<%- include(‘/partials/headerindex’, { pageTitle: ‘Home’, showSidebar: false, barname:‘user’ }) %>
<%- include(‘…/…/partials/headerindex’, { pageTitle: ‘Home’, showSidebar: false, barname:‘user’ }) %>

Hey,

I see that you’ve already initiated a support ticket with us. To avoid any confusion or duplicate efforts, let’s continue the conversation there.

Jérémy.
Render Support, UTC+3

Hi Jeremy,

Thanks for your response. Actually, all my view filenames are in lower case

<%- include(‘/partials/headerindex’, { pageTitle: ‘Home’, showSidebar: false, barname:‘user’ }) %>
<%- include(‘…/…/partials/headerindex’, { pageTitle: ‘Home’, showSidebar: false, barname:‘user’ }) %>

Or since render is linus Os base, should i use \ instead of /

Regards
Daniel Njoku

I am getting the below now:

Sep 14 01:38:50 PM ==> Cloning from h ttps: // github .com/njokdan/flowerapp…
Sep 14 01:38:51 PM ==> Checking out commit 143119c2641fd4a4a9e6f9eb6112cfb9abd3ee08 in branch main
Sep 14 01:38:54 PM ==> Downloading cache…
Sep 14 01:39:04 PM ==> Transferred 2.5MB in 7s. Extraction took 0s.
Sep 14 01:39:05 PM ==> Using Node version 20.6.1 via /opt/render/project/src/package.json
Sep 14 01:39:05 PM ==> Docs on specifying a Node version: h ttps:// render. com/docs/node-version
Sep 14 01:39:05 PM ==> Running build command ‘yarn’…
Sep 14 01:39:05 PM builder.sh: line 33: 47 Segmentation fault bash -c – “$USER_BUILD_CMD”
Sep 14 01:39:05 PM ==> Build failed :disappointed:
Sep 14 01:39:05 PM ==> Using Node version 20.6.1 via /opt/render/project/src/package.json
Sep 14 01:39:05 PM ==> Docs on specifying a Node version: https: // Specifying a Node Version | Render
Sep 14 01:39:05 PM ==> Running build command ‘yarn’…
Sep 14 01:39:05 PM builder.sh: line 33: 47 Segmentation fault bash -c – “$USER_BUILD_CMD”
Sep 14 01:39:05 PM ==> Build failed :disappointed:
Sep 14 01:39:05 PM ==> Using Node version 20.6.1 via /opt/render/project/src/package.json
Sep 14 01:39:05 PM ==> Docs on specifying a Node version: h ttps://render. com/docs/node-version
Sep 14 01:39:05 PM ==> Running build command ‘yarn’…
Sep 14 01:39:05 PM builder.sh: line 33: 47 Segmentation fault bash -c – “$USER_BUILD_CMD”
Sep 14 01:39:05 PM ==> Build failed :disappointed:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.