NodeJs - esc is not a function

前端 未结 3 2039
栀梦
栀梦 2021-02-14 20:55

I got a weird issues when trying to render an .ejs file at this specific lines

TypeError: /home/me/nodeapp/app/views/default/page/connection.ejs:66
             


        
3条回答
  •  时光说笑
    2021-02-14 21:32

    First thanks for your answers.

    I figured out the issue.

    The error was in the included EJS file<%- include ('../api_html/connection/connection_list.ejs') %>.

    For example, if you include <% include ../partials/header %> that contains <%= user.email %>, it will work perfectly when the user is defined (user is logged in) but will throw esc in not a function when it's not.

提交回复
热议问题