Comments (27)
i cant register
you should do this: <% include ('partials/messages') %>
from node_passport_login.
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.
@NuPhan123
To fix this error you need to understand why it is happening
Some Error Reason;
- View engine may not be set
Solution - app.set("view engine", "ejs"); add this in server.js file - 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 - Syntax error - correct syntax is <%- include("file_path"); -%>
from node_passport_login.
just use this <%- include ./partials/messages %>
Hope this worked...
from node_passport_login.
Use this syntax , It will work <%- include ("./partials/messages"); %>
from node_passport_login.
I have the same problem...
Please try this: <% include ('partials/messages') %>
from node_passport_login.
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.
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.
This worked for me
<%- include("partials/messages") %>
from node_passport_login.
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.
thanks for all the solutions provided above, <%- include("./partials/messages"); %>
this worked for me.
from node_passport_login.
I have the same problem...
from node_passport_login.
<%- include ('partials/messages') %> include hyphen in the statement
from node_passport_login.
<%- include ('partials/messages') %> include hyphen in the statement
is not working
from node_passport_login.
<%- include('partials/messages') %> worked for me
from node_passport_login.
I have the same problem. None of the solutions work.
from node_passport_login.
Same issue here <%- include('partials/messages') %> is not working for me it showing the same error
from node_passport_login.
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.
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.
not working still.. it says success_msg is not defined
from node_passport_login.
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.
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.
from node_passport_login.
Try <% include ./partials/messages %> for me works.
from node_passport_login.
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.
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.
Use this syntax , It will work <%- include ("./partials/messages"); %>
thanks it helped.
from node_passport_login.
Related Issues (20)
- UnhandledPromiseRejectionWarning: MongooseError: Operation `users.findOne()` buffering timed out after 10000ms HOT 4
- Error on opening Register Page HOT 2
- Error On Opening Login Page HOT 1
- Problem with passport middle authentication HOT 2
- title for test issue HOT 1
- Test 2
- test 3
- test
- Register >> if email already exists
- SyntaxError: Unexpected token '/'
- email Match
- Please help ... Bootstrap is not working
- messages.ejs showing errors (Screenshot Attached.) HOT 2
- Include statement in ejs file not correct HOT 1
- ReferenceError: newUser is not defined HOT 1
- How to deploy in IBM cloud? HOT 1
- Could not find the include file "./partials/messages" HOT 2
- _mongoose.Error.OverwriteModelError(name); HOT 2
- Error: No default engine was specified and no extension was provided. at new View (D:\Node_Passport\node_modules\express\lib\view.js:61: HOT 1
- MongoDB Compass Local URI not connecting HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node_passport_login.