Механизм шаблонов не может найти navigation.ejs - PullRequest
0 голосов
/ 10 июля 2020

enter image description here

I get this reference error from ejs. Path not found, meanwhile I have the file in my includes folder. When I change navigation.ejs to a different file (let's say end.ejs) I don't get the error.

enter image description here

importing navigation.ejs in the body tag.

введите описание изображения здесь

включает папку.

Ответы [ 2 ]

0 голосов
/ 11 июля 2020

Ваш путь неверен. Сначала вам нужно перейти в каталог вверх:

<%- include('./../includes/navigation.ejs') %>
0 голосов
/ 11 июля 2020

Путь к объекту не был включен в метод рендеринга. Поэтому при переходе по неизвестному URL-адресу происходит ошибка.

enter image description here

It errors out here because the path was not included to the object in the render method. введите описание изображения здесь

...