'TypeError: /Users/ac/Downloads/BeFound/views/profile.ejs:91

Got this error when I click on a page in my nodejs app and im not sure what's wrong with it

TypeError: /Users/ac/Downloads/BeFound/views/profile.ejs:91
    89|                       
    90|                       <div>
 >> 91|                         <%- include('profilePartials/options') %>
    92|                       </div>
    93| 
    94|                      

/Users/ac/Downloads/BeFound/views/profilePartials/options.ejs:5
    3|         <div>
    4|    <div  id="opt-newsfeed">
 >> 5|     <%- include('newsfeed') %> 
    6|    </div>
    7|    <div id="opt-profile">
    8|     <%- include('detailedProfile') %> 

/Users/ac/Downloads/BeFound/views/profilePartials/newsfeed.ejs:268
    266|                                   
    267| 
 >> 268|                                     <img class="commentimg" src="<%= com.createdBy.displayPicture.image %>" alt="altt"
    269|                                     style="border-radius: 50%" />
    270|                                   <% } %>
    271| 

Cannot read properties of undefined (reading 'image')
    at eval ("/Users/ac/Downloads/BeFound/views/profilePartials/newsfeed.ejs":174:55)
    at Proxy.forEach (<anonymous>)
    at eval ("/Users/ac/Downloads/BeFound/views/profilePartials/newsfeed.ejs":141:22)
    at Array.forEach (<anonymous>)
    at eval ("/Users/ac/Downloads/BeFound/views/profilePartials/newsfeed.ejs":15:14)
    at newsfeed 

(/Users/ac/Downloads/BeFound/node_modules/ejs/lib/ejs.js:692:17) at include (/Users/ac/Downloads/BeFound/node_modules/ejs/lib/ejs.js:690:39) at eval ("/Users/ac/Downloads/BeFound/views/profilePartials/options.ejs":12:17) at options (/Users/ac/Downloads/BeFound/node_modules/ejs/lib/ejs.js:692:17) at include (/Users/ac/Downloads/BeFound/node_modules/ejs/lib/ejs.js:690:39)



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source