Please I need someone to tell me what I am doing wrong as my code is not passing test 1

Tell us what’s happening:
Describe your issue in detail here.

I get this error on the console
Error: Failed to lookup view “pug” in views directory “./views/pug”

Your project link(s)

This is my solution link


Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36

Challenge: Implement the Serialization of a Passport User

Link to the challenge:

line 40 and 59, res.render('pug' . I don’t see you have a file named pug.pug in ./views/pug.
res.render’s first argument is a file name (without extension, e.g. res.render('chat', ....
I might be wrong though.

It should be index with that setup or you can comment out the app.set('views', './views/pug') and render pug (which should pick the index file).

I think it is because the challenge that had you set up the Template Engine didn’t expect you to use app.set but res.render and that code is then moved inside the DB connection function and the first argument is changed.

Set up Template Engine

Implement the Serialization of a Passport User

1 Like

You are right just had to comment out app.set(‘views’, ‘./views/pug’) and passed the test.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.