Not able to deploy (Using embedded js, mongo db atlas and express js)

This is my repository on Github-> GitHub - melbourne2827/Budgr2: A budget tracking website
I’ve been trying to deploy this using the new web service option. I set the build command as npm install, start command as node app.js and set the environment variable for DB_URL (Mongo DB Atlas Database Used). This project runs perfectly well on my localhost. But I end up getting this error from render

ReferenceError: views/layouts/boilerplate.ejs:16

Apr 26 06:55:57 PM 14|

Apr 26 06:55:57 PM 15|

Apr 26 06:55:57 PM >> 16| <%- include(‘…/partials/navbar’) %>

Apr 26 06:55:57 PM 17|

Apr 26 06:55:57 PM 18| <%-include(‘…/partials/flash’) %>

Apr 26 06:55:57 PM 19| <%- body %>

/opt/render/project/src/views/partials/navbar.ejs:9

Apr 26 06:55:57 PM 7|

Apr 26 06:55:57 PM 8|

    Apr 26 06:55:57 PM >> 9| <% if(currentUser){ %>

    Apr 26 06:55:57 PM 10|

  • Apr 26 06:55:57 PM 11| analytics

    Apr 26 06:55:57 PM 12|

  • currentUser is not defined

    Apr 26 06:55:57 PM at eval (“/opt/render/project/src/views/partials/navbar.ejs”:12:8)

    Apr 26 06:55:57 PM at navbar (/opt/render/project/src/node_modules/ejs/lib/ejs.js:703:17)

    Apr 26 06:55:57 PM at include (/opt/render/project/src/node_modules/ejs/lib/ejs.js:701:39)

    Apr 26 06:55:57 PM at eval (“views/layouts/boilerplate.ejs”:12:17)

    Apr 26 06:55:57 PM at boilerplate (/opt/render/project/src/node_modules/ejs/lib/ejs.js:703:17)

    Apr 26 06:55:57 PM at tryHandleCache (/opt/render/project/src/node_modules/ejs/lib/ejs.js:274:36)

    Apr 26 06:55:57 PM at exports.renderFile (/opt/render/project/src/node_modules/ejs/lib/ejs.js:491:10)

    Apr 26 06:55:57 PM at renderFile (/opt/render/project/src/node_modules/ejs-mate/lib/index.js:298:7)

    Apr 26 06:55:57 PM at /opt/render/project/src/node_modules/ejs-mate/lib/index.js:353:7

    Apr 26 06:55:57 PM at tryHandleCache (/opt/render/project/src/node_modules/ejs/lib/ejs.js:280:5)

    Could someone tell me as to what is going wrong??

Hey,

The error ‘currentUser is not defined’ seems to be causing your deployment to fail. This isn’t an issue on our end, but you’ll need to check that ‘currentUser’ is properly defined at this point in your code. If you can provide more details about what ‘currentUser’ is and how you’re using it, we might be able to help a bit more, though our ability to assist with code-related issues is limited. Also, make sure your MongoDB connection is set up correctly—like whitelisting the Render outbound IP on MongoDB, for example.

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