0

I've been using the following code with success across my whole website, its just a variable that is passed to the EJS to load a header:

Node

res.render('main', {
    header: 'header1.ejs'
});

EJS

<%- include(header) %>

Today I switched from using "bcrypt" to using "bcrypt-nodejs" and now EJS gives me the following error every time I try and open a page.

Error: ENOENT, no such file or directory 'C:\Users\user\Desktop\node\views( header).ejs'

It seems to have forgotten how to parse variables, but only when coupled with Include as other variables passed to EJS still work. Removing "bcrypt-nodejs" doesn't seem to have fixed the problem. Does anyone have any idea what I've done wrong?

1 Answer 1

0

Figured it out, has nothing to do with bcrypt. EJS has updateded, the proper syntax is now:

 <% include header %>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.