Skip to content

App doesn't load: Cannot read 'path' property of undefined #5

@1papaya

Description

@1papaya

Steps taken:

After executing yarn run serve it throws an error (below) and the site at localhost:3000 doesn't load.

Metalsmith error: { TypeError: /home/user/proj/ram/ram/app/layouts/post.html:20
    18|             </a>
    19|           </div>
 >> 20|           <%- include('../includes/navigation') %>
    21|         </div>
    22|       </header>
    23| 

/home/user/proj/ram/ram/app/includes/navigation.ejs:11
    9|     <section class="ppn__section">
    10|       <h3 class="ppn__section-title"><%= site.sectionsMeta[k] %></h3>
 >> 11|       <%- include('../includes/nav-item', {children: sections[k].children}) %>
    12|     </section>
    13|     <% }) %>
    14| 

/home/user/proj/ram/ram/app/includes/nav-item.ejs:16
    14|       <% var activeClass = children[k].item.path === path ? 'ppn__menu-item--active' : '' %>
    15|       <a href="<%- site.baseurl %>/<%= children[k].item.path %>" title="Go to page" class="ppn__menu-item <%- activeClass %>"><%= children[k].item.title %></a>
 >> 16|       <%- include('nav-item', {children: children[k].children || []}) %>
    17|   </li>
    18|   <% }) %>
    19| </ul>

/home/user/proj/ram/ram/app/includes/nav-item.ejs:14
    12|   <% keys.forEach(function(k) { %>
    13|   <li>
 >> 14|       <% var activeClass = children[k].item.path === path ? 'ppn__menu-item--active' : '' %>
    15|       <a href="<%- site.baseurl %>/<%= children[k].item.path %>" title="Go to page" class="ppn__menu-item <%- activeClass %>"><%= children[k].item.title %></a>
    16|       <%- include('nav-item', {children: children[k].children || []}) %>
    17|   </li>

Cannot read property 'path' of undefined
    at eval (eval at compile (/home/user/proj/ram/ram/node_modules/ejs/lib/ejs.js:524:12), <anonymous>:27:42)
    at Array.forEach (native)
    at eval (eval at compile (/home/user/proj/ram/ram/node_modules/ejs/lib/ejs.js:524:12), <anonymous>:24:13)
    at returnedFn (/home/user/proj/ram/ram/node_modules/ejs/lib/ejs.js:555:17)
    at include (/home/user/proj/ram/ram/node_modules/ejs/lib/ejs.js:553:39)
    at eval (eval at compile (/home/user/proj/ram/ram/node_modules/ejs/lib/ejs.js:524:12), <anonymous>:39:17)
    at Array.forEach (native)
    at eval (eval at compile (/home/user/proj/ram/ram/node_modules/ejs/lib/ejs.js:524:12), <anonymous>:24:13)
    at returnedFn (/home/user/proj/ram/ram/node_modules/ejs/lib/ejs.js:555:17)
    at include (/home/user/proj/ram/ram/node_modules/ejs/lib/ejs.js:553:39)
    at eval (eval at compile (/home/user/proj/ram/ram/node_modules/ejs/lib/ejs.js:524:12), <anonymous>:23:17)
    at Array.forEach (native)
    at eval (eval at compile (/home/user/proj/ram/ram/node_modules/ejs/lib/ejs.js:524:12), <anonymous>:17:16)
    at returnedFn (/home/user/proj/ram/ram/node_modules/ejs/lib/ejs.js:555:17)
    at include (/home/user/proj/ram/ram/node_modules/ejs/lib/ejs.js:553:39)
    at eval (eval at compile (/home/user/proj/ram/ram/node_modules/ejs/lib/ejs.js:524:12), <anonymous>:29:17) path: '/home/user/proj/ram/ram/app/layouts/post.html' }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions