Giter Site home page Giter Site logo

Comments (27)

zykovmv avatar zykovmv commented on May 26, 2024 8

image

i cant register

you should do this: <% include ('partials/messages') %>

from node_passport_login.

zebmastah avatar zebmastah commented on May 26, 2024 7

I have the issue too, <% include ('partials/messages') % resolves the error but won't fix it. The errors won't display as his tutorial show.

It did work, however you have to keep the hyphen in the code like so:
<%- include ('partials/messages') %>

from node_passport_login.

najimali avatar najimali commented on May 26, 2024 2

@NuPhan123
To fix this error you need to understand why it is happening

Some Error Reason;

  1. View engine may not be set
    Solution - app.set("view engine", "ejs"); add this in server.js file
  2. The path is not correct
    Solution - Check your folder structure
    dot-slash (./) means you are pointing to the current directory so I am assuming your register template is views directory & message.ejs file in partials directory then the path will be ./partials/message
    if your register template is in views/user directory then use double dot to move one directory backward
    ../partials/message
  3. Syntax error - correct syntax is <%- include("file_path"); -%>

from node_passport_login.

sattu444 avatar sattu444 commented on May 26, 2024 2

just use this <%- include ./partials/messages %>

Hope this worked...

from node_passport_login.

sania-iftikhar avatar sania-iftikhar commented on May 26, 2024 2

Use this syntax , It will work <%- include ("./partials/messages"); %>

from node_passport_login.

zykovmv avatar zykovmv commented on May 26, 2024 1

I have the same problem...

Please try this: <% include ('partials/messages') %>

from node_passport_login.

zebmastah avatar zebmastah commented on May 26, 2024 1

I have the issue too, <% include ('partials/messages') % resolves the error but won't fix it. The errors won't display as his tutorial show.

from node_passport_login.

hackrx avatar hackrx commented on May 26, 2024 1

Guys use this it wroked for me <%- include ('./partials/messages'); %>
I think newer version on ejs supports this format.
Don't forget to add -(hyphen) in beg. and a semicolon ;

from node_passport_login.

P-oke avatar P-oke commented on May 26, 2024 1

This worked for me

<%- include("partials/messages") %>

from node_passport_login.

myworldbox avatar myworldbox commented on May 26, 2024 1

The error is the blank space after the include
go to views > partials > register.js and change <%- include ("./partials/messages"); %> to <%- include("./partials/messages"); %>

from node_passport_login.

Joshua-Coded avatar Joshua-Coded commented on May 26, 2024 1

thanks for all the solutions provided above, <%- include("./partials/messages"); %>
this worked for me.

from node_passport_login.

joelruizcabrera avatar joelruizcabrera commented on May 26, 2024

I have the same problem...

from node_passport_login.

vigneshrathnam avatar vigneshrathnam commented on May 26, 2024

<%- include ('partials/messages') %> include hyphen in the statement

from node_passport_login.

lkarjun avatar lkarjun commented on May 26, 2024

<%- include ('partials/messages') %> include hyphen in the statement

is not working

from node_passport_login.

MdYusufBinNur avatar MdYusufBinNur commented on May 26, 2024

<%- include('partials/messages') %> worked for me

from node_passport_login.

kenwaysharma avatar kenwaysharma commented on May 26, 2024

I have the same problem. None of the solutions work.

from node_passport_login.

hackrx avatar hackrx commented on May 26, 2024

Same issue here <%- include('partials/messages') %> is not working for me it showing the same error

from node_passport_login.

kiranmurali93 avatar kiranmurali93 commented on May 26, 2024

Guys use this it wroked for me <%- include ('./partials/messages'); %>
I think newer version on ejs supports this format.
Don't forget to add -(hyphen) in beg. and a semicolon ;

It didn't work for me so what I did was instead of making a separate file for messages
I replaced <%- include ('./partials/messages'); %>
with the contents in message.ejs

from node_passport_login.

sikander804 avatar sikander804 commented on May 26, 2024

Guys use this it wroked for me <%- include ('./partials/messages'); %>
I think newer version on ejs supports this format.
Don't forget to add -(hyphen) in beg. and a semicolon ;

It didn't work for me so what I did was instead of making a separate file for messages
I replaced <%- include ('./partials/messages'); %>
with the contents in message.ejs

still not working.

from node_passport_login.

 avatar commented on May 26, 2024

not working still.. it says success_msg is not defined

from node_passport_login.

 avatar commented on May 26, 2024

Ok guys, I was receiving the exact same error message an hour ago and just got it to work.
To fix the first error, you have to go <%- include("partials/messages") -%>
To fix the success_msg is not defined error, make sure your router, app.use('/', require('./routes/index.js')); and app.use('/users', require('./routes/users.js'));, is below app.use(flash()) like how Brad has it in the repo. If you're getting an error message like req.flash() is not a function, changing the router position is also the fix. Hope this helped

from node_passport_login.

eidan66 avatar eidan66 commented on May 26, 2024

Same issue here <%- include('partials/messages') %> is not working for me it showing the same error

you need write like this : <%- include ('./partials/messages') %>
you miss the -- > './' before partials

from node_passport_login.

NuPhan123 avatar NuPhan123 commented on May 26, 2024

from node_passport_login.

alexeystardev avatar alexeystardev commented on May 26, 2024

Try <% include ./partials/messages %> for me works.

from node_passport_login.

blackhoole avatar blackhoole commented on May 26, 2024

I have the same problem ,and i have tried almost all the solution above,
such as <% include ./partials/messages %> <%- include ("./partials/messages"); %>
<%- include('./partials/messages'); %> , but none of them work.
and finally i realized its not about the include statement , it's about the messages.ejs
there is some grammer mistake that i made in the messages.ejs ,after correct that grammer error, things get work

from node_passport_login.

kushwahasanket avatar kushwahasanket commented on May 26, 2024

probably you have not included partials .. you can show your file structure ..or just delete <% include ./partials/messages %> this line from both login and register file it will work . but no css will be included

from node_passport_login.

odysseus1999 avatar odysseus1999 commented on May 26, 2024

Use this syntax , It will work <%- include ("./partials/messages"); %>

thanks it helped.

from node_passport_login.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.