The sound on the original video wasn't good, so I had to re-upload it. Re smash the like button for me pls * Updates TypeError: flash is not a function - please use another flash package like "connect-flash". I have updated the code on GitHub and you can follow the update instructions on my blog. Link in description. (too much to fit in here)
@vatansrivastava7279 Жыл бұрын
I have just smashed the like button for this reason... thanks
@sigfigronath Жыл бұрын
Thanks for the reupload, this is much better !
@RaddyDev Жыл бұрын
Glad to hear that. Thank you!
@bharat0308 Жыл бұрын
Very good video @Raddy 😊
@RaddyDev Жыл бұрын
Thanks Bharat!
@sircrimsondeath6 ай бұрын
Thank you Raddy for such an informative and well put video on NodeJS, have a good one mate!
@_r.igh_t. Жыл бұрын
Thank you Raddy, very intersting and helpful course - great!!!
@RaddyDev Жыл бұрын
Glad you liked it!
@tarunsahu1366 Жыл бұрын
1:16:31 after making all the changes,still I am getting the result as TypeError: flash is not a function .I installed express-flash-message,did all the steps but ending up with flash is not a function .Plz help im stuck at this part
@RaddyDev Жыл бұрын
Did you manage to fix it? Put your flash middleware before your routes
@augustok.8537 Жыл бұрын
im with the same problem
@RaddyDev Жыл бұрын
@@augustok.8537 Same solution? Make sure that you have added flash messages. Maybe check for typos
@stevonduddly5709 Жыл бұрын
@@RaddyDev I am getting no output on the redirect for flash messages... i have done all the steps but no output?
@zoyaghavte16663 ай бұрын
Hi, i faced the same issue, use the code used in the git repositry for flash dont forget: npm install connect-flash
@ianthediver25417 ай бұрын
Excellent tutorial. Thank you. Liked and subscribed
@TheEmmanuelN Жыл бұрын
Best course on Nodejs and Express for both frontend and backend. Thank you very much Raddy! Would you do another course for Node, Express, MongoDB Login and Registration please? That would be awesome as well. Thanks again Sir
@RaddyDev Жыл бұрын
I appreciate you saying that, Emmanuel. I recently did one that uses Google Authentication. Now this video and the other one are very similar in functionality. Maybe you could add the authentication just by watching that specific part. Here is the video if you wish to check it out. kzbin.info/www/bejne/eHXSYp-dlr-of6s
@UssopSamah7 ай бұрын
you are realy an angel sent to save me from all my stress { npm install , code ., .env mongo pasted } to those that understand 😄😄😄😄😄
@Nishikant0075 ай бұрын
it was too good sir ..................... keep it up ..
@govindpvenu Жыл бұрын
if your are getting Flash is not a function do the following: npm uninstall express-flash-message npm i express-flash-message@2.1.0
@saulo_foot Жыл бұрын
How can i handle this without keeping a deprecated version of express-flash-message? Thanks
@lefamello9432 Жыл бұрын
life saver thank you
@kathirmldata7411 Жыл бұрын
thank you !
@n.rajeshkumar3695Ай бұрын
Thank you very much bro 🙏
@siryellow371 Жыл бұрын
I hope you can code the same thing (a similar video) but add the file upload feature!!
@muhammedrafi9600 Жыл бұрын
Could you do a video about how OTP mobile and email verification doing when signing up using node js, express js, mongodb
@Suumaalacademy28 күн бұрын
Thanks 😊 you very it's very much appreciated
@RaddyDev26 күн бұрын
Most welcome 😊
@yashpaliwal9053 Жыл бұрын
Hi Raddy, @1:35:14 I am getting an error like this Customer.count is not a function Can you please help me
@RaddyDev Жыл бұрын
Hi, can you please try .countDocuments({}) instead. Count is now deprecated in the new Mongoose version. I will update the GitHub page
@voboghure3433 Жыл бұрын
Hi Raddy, very good video, what vscode extension you use for quickly linked from routes to controller?
@RaddyDev Жыл бұрын
I only have the EJS language support installed. It must be a VSC feature... Hold CTRL when you hover and you get the link
@cesaremannino2774 Жыл бұрын
Hi Raddy, very good video as usual top! I will give you an idea for your next one, you would help a lot of people. Create a tutorial to deploy a full stack app, database included (possibly MySQL), since I'm sure a lot of people are still trying to migrate from Heroku to other services, cheaper or possibly free(for example Railway)...asking for a friend:))))
@rahulbhagat4023 Жыл бұрын
1:16:53 I m getting an error as TypeError: flash is not a function Please help
@RaddyDev Жыл бұрын
Somebody in the comments was able to solve that. I think that it was something to do with the new version. I'll have a look later to see if I can find it. Just scroll down and you'll probably see it
@rahulbhagat4023 Жыл бұрын
Yeah I got it ....thanks for replying 😊
@allinonetrick3435 ай бұрын
i am getting an error that, customers.forEach is not a function please help me with that, how can i fix it.
@RaddyDev5 ай бұрын
In your res.render("index", { locals, customers.... do you pass the customers? If so, do you get data from the database when you do const customers = await Customer......?
@allinonetrick3434 ай бұрын
@@RaddyDev thank you for guiding me.
@adityaparkhe5121 Жыл бұрын
At 49:18, How did the add page not render as a whole other page, but rendered over the admin dashboard as its body?
@RaddyDev Жыл бұрын
It did render as a new page. It loads fast and the layout stays the same which might make you think that it only refreshed the content
@samirrahmedd9248 Жыл бұрын
1:27:23 i have a problem: customers is not defind
@RaddyDev Жыл бұрын
That should be an easy fix. Make sure that you are you have "customers" inside your "res.render". Example: res.render('index', { customers ...
@n.rajeshkumar3695Ай бұрын
bro i'm also facing the same issue. could not figured it out. If you solve this please tell me how to fix.
@user-rxeuzf9 ай бұрын
TANK U SO MUCK MY BRAZEER U HELPING ME ALOT TY TY TY U ARE THE BEEEEEEEEEST MOZERFOKER ON THIS PLATFOOOOOORM RADDY GOATED
@RaddyDev9 ай бұрын
😂😂😂 That made me laugh, thank you!
@scyhe6dsh Жыл бұрын
Great Job
@RaddyDev Жыл бұрын
Thank you!
@Tazibetmanel Жыл бұрын
hey good video thanks but i have a probleme with the part of flash messages i know it's not a big deal for the crud process but i realy want to have them can you help me with it keeps saying consumeFlash is not a function at first it said flash is not when i give it require express-flash-message then i tried connect-flash it worked for the flash function but now the consumeFlash doesn't work
@RaddyDev Жыл бұрын
Unfortunately that package has been updated and that's why is giving us an error. Use connect-flash and then just replace consumeFlash with const messages = await req.flash("info"); There is a link in the description that shows the steps to get it to work
@balizaz Жыл бұрын
At 1:36:19 Can you make a video for fetch API pagination?
@RaddyDev Жыл бұрын
It would be the same, just using a different method of fetching the data. Unless you mean like a Load More pagination style?
@balizaz Жыл бұрын
@@RaddyDev I have 115 pages, When I click page from 1-6 It is OK, but when I click page 15, It shows 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15, and If I click 100, It shows from 1 to 100. I think the problem is the loop:
@sanje_238 ай бұрын
i'm having a pagination error, why does when i go to other pages and leave page 1 the other pages doesn't show? the only thing left in the pagination are the first and last? looking forward for your suggestions thankyou!
@RaddyDev8 ай бұрын
Hard to tell without seeing the code. Could you copy/paste the pagination from the project on GitHub and try it. Obviously make sure that you have enough records to paginate
@sanje_238 ай бұрын
@@RaddyDev here's the code based on your tutorial 0) { %> First First Previous Previous 5 ? Number(current) - 4 : 1) %> ... Next Last Last
@rahulbhagat4023 Жыл бұрын
At about 2:13:00 I am getting an error as: CastError: Cast to ObjectId failed for value "${req.params.id}" (type string) at path "_id" for model "Customer" reason: BSONError: Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer Please help!!
It's the same code from the video😅....... When I click on edit customer icon and fill new details and then click on update customer, the web page keeps on buffering but when I click on node js icon to go back to homepage and see that the chosen user has been updated with new details. So problem is with the upadte customer icon which buffers the page when clicked on it so I suppose there's some error with the edit customer data in customer controller....Have a look at my code from customer controller.js : /** * get/ * edit customer data */ exports.edit= async(req,res)=>{ try{ const customer= await Customer.findOne({_id: req.params.id}) const locals={ title:"Edit Customer Data", description:"Free NodeJs User Management System", }; res.render('customer/edit',{ locals, customer }) } catch (error){ console.log(error); } } /** * get/ * update customer data */ exports.editPost= async(req,res)=>{ try{ await Customer.findByIdAndUpdate(req.params.id,{ firstName:req.body.firstName, lastName:req.body.lastName, tel:req.body.tel, email:req.body.email, details:req.body.details, updatedAt:Date.now() }); await res.redirect('/edit/${req.params.id}'); console.log('redirected'); }catch(error){ console.log(error); } } and here's the code from customer.js : const express= require('express') const router =express.Router(); const customerController = require('../controllers/customerController'); /** * customer routes */ router.get('/',customerController.homepage); router.get('/add',customerController.addCustomer); router.post('/add',customerController.postCustomer); router.get('/view/:id',customerController.view); router.get('/edit/:id',customerController.edit); router.put('/edit/:id',customerController.editPost); module.exports=router;
@RaddyDev Жыл бұрын
@@rahulbhagat4023 In your GET / Update Customer Data, where you have the redirect code, you need the back-ticks (` `) instead rather than single quotes. That will make your Template Literal work res.redirect(`/edit/${req.params.id}`);
@rahulbhagat4023 Жыл бұрын
I am really sorry for that silly mistake......It worked now....Thank you so much
@mejjithomas5 ай бұрын
Sir my nodemon app crashed and it is showing an error that unexpected token in node modules how can i fix it!? Please help me with this!
@RaddyDev5 ай бұрын
Can you link in what part of the tutorial this is happening. Without seeing the code is hard to pinpoint the problem, but I am more than happy to try to help you out
@mejjithomas5 ай бұрын
1:50:04 I was just stuck here,I sorted out my error and ofc thank you soo much for this it worked out so well! Keep going you are just wonderful!😊🤍~
@mejjithomas5 ай бұрын
@@RaddyDev 2:06:22 i was stuck here,but anyway i cleared it,thank you so much for this tutorial ,it helped me a lot and the results came out so well!! I am just a 12th completed student and this taught me a lot THANKYOU !Keep going sir you are just wonderful!😊❤
@asfiyapeerzade3438 Жыл бұрын
Error: Failed to lookup view "./layouts/main" in views directory "C:\Users\Acer\Desktop\mini project\views" at Function.render (C:\Users\Acer\Desktop\mini project ode_modules\express\lib\application.js:597:17) at ServerResponse.render (C:\Users\Acer\Desktop\mini project ode_modules\express\lib esponse.js:1039:7) at C:\Users\Acer\Desktop\mini project ode_modules\express-ejs-layouts\lib\express-layouts.js:113:20 at tryHandleCache (C:\Users\Acer\Desktop\mini project ode_modules\ejs\lib\ejs.js:280:5) at exports.renderFile [as engine] (C:\Users\Acer\Desktop\mini project ode_modules\ejs\lib\ejs.js:491:10) at View.render (C:\Users\Acer\Desktop\mini project ode_modules\express\lib\view.js:135:8) at tryRender (C:\Users\Acer\Desktop\mini project ode_modules\express\lib\application.js:657:10) at Function.render (C:\Users\Acer\Desktop\mini project ode_modules\express\lib\application.js:609:3) at ServerResponse.render (C:\Users\Acer\Desktop\mini project ode_modules\express\lib esponse.js:1039:7) at res.render (C:\Users\Acer\Desktop\mini project ode_modules\express-ejs-layouts\lib\express-layouts.js:77:18) what should i do pls explain its urgent
@RaddyDev Жыл бұрын
The error means that it's failing to find the file/directory. Simply put it could be a typo. Make sure that you have a folder called views and inside that folder you have layouts and then you have main.ejs. So views -> layouts -> main.ejs. That should solve your problem
@yedukondalu91004 ай бұрын
i replaced with your code for flash is not a function but i didnt get any result , its keep on buffering when i click on new user button, please help me bro
@RaddyDev4 ай бұрын
Did you manage to figure it out? You can reference the code on github
@OutsidePro9 Жыл бұрын
hi raddy. i have problem like this : fatal true code 'protocol_connection_lost' . can help me to fix ?
@RaddyDev Жыл бұрын
Hey Chann, when does this happen? Did you manage to solve it?
@OutsidePro9 Жыл бұрын
@@RaddyDev hi raddy , i have problem like this : ( fatal: true, code: 'PROTOCOL_CONNECTION_LOST') in node js . can help me give some idea to fix this problem ? ,thanks you your advance .
@RaddyDev Жыл бұрын
@@OutsidePro9 That's a strange one. At what part of the video do you get the error?
@CafiifaHariir9 ай бұрын
which browser you use when i start browser i can't see the result of my code so help me bro
@RaddyDev8 ай бұрын
You should be able to use any browser. I normally use Brave. Do you get any errors?
@BK-qe7xi Жыл бұрын
Hi can i use port 3000 instead of 5000?
@RaddyDev Жыл бұрын
Yep, you can do. It doesn't really matter which one you choose, whatever works for you. Then when you publish your app you can use the platform environment port number
@ochogwuemmy8171 Жыл бұрын
Hi Raddy... I could not host the app What could be the possible problem with error 502
@RaddyDev Жыл бұрын
Look into the Hosting logs when you deploy and they will tell you what the problem is. Could be something small like a port number that needs changing
@ochogwuemmy8171 Жыл бұрын
@@RaddyDev the app was showing live sir.... But when I tried to run it it kept on loading and after sometimes it shows error 502. I got the same on both render and cyclic and I actually followed your tutorial on alternative to Heroku.... Could it be the files arrangement?
@RaddyDev Жыл бұрын
@@ochogwuemmy8171 It's hard to say. You'll have to do some debugging and see when it happens
@lucaskriger5666 Жыл бұрын
How can I add middlewares to this app?
@RaddyDev Жыл бұрын
You could do this: router.get('/about', MyMiddleware(), customerController.about); Real example: router.get('/about', cors(), customerController.about);
@ramendrasoni3368 Жыл бұрын
Need user management with image upload...
@harshitsingh-u4f Жыл бұрын
Please made a video on diiferent user Roles using auth using NodeJs MonogoDB Express and EJS
@tharakasandaruwanmanohara6950 Жыл бұрын
I get this error when I tried to update the details "Cannot POST /edit/64d6fccc89b0859fc92bc421"
@tharakasandaruwanmanohara6950 Жыл бұрын
I fixed this. But my delete function is not working
@RaddyDev Жыл бұрын
Do you get an error from the delete route? If you let me know what it is I can try to help
@tharakasandaruwanmanohara6950 Жыл бұрын
@@RaddyDev yes. I think the delete route is not working. If I tried to delete some customer details it redirected as I clicked the updated button.
@simran78339 ай бұрын
hey will u let me know how u solve this error as i am facing same issue ?
@AkshayKumar-yu1jh Жыл бұрын
Dear sir,I got the same error as you got but after following the path I am still getting the same error. That is flash is not a function
@RaddyDev Жыл бұрын
If I remember correctly the flash package is now deprecated. I published a fix not long ago - link in description
@shaun464 Жыл бұрын
How can i deploy this app, can someone please help
@RaddyDev Жыл бұрын
You could try using Render as they make the process super easy. I've done a couple of tutorials on Cyclic and Render that you can use. Another option would be to get a cheap Virtual Private Server, but it's not as easy to setup
@arafatali425911 ай бұрын
When i have create project with nodejs and i need to host it, how can i host it
@RaddyDev11 ай бұрын
Any VPS or maybe Render and Cyclic. Plenty of options out there
@arafatali425911 ай бұрын
@@RaddyDev hello my friend, I try to host my nodejs in my VPS and I upload everything there, so when I run curl - v server IP : my port.in my VPS, It show that is connected. But when I try in my local computer my browse tell me it can't reached how can I solve this problem, in firewall everything is good
@arafatali425911 ай бұрын
@RaddyDev when I run that link in my VPS server is work properly. But out side is not
@RaddyDev11 ай бұрын
It does sound like a firewall issue. Double check to see if you have the same port number open as the one your NodeJs application runs on. Could try a common port number and maybe use an online scanner to see if the port is open. I can't think of anything else at the moment... Let me know how it goes and I hope that you figure it out
@arafatali425911 ай бұрын
@RaddyDev thanks my friend, everything going well. Can I have your email or WhatsApp number for more contact, please. My name is Arafat
@alizasayyad2142 Жыл бұрын
Can anyone tell how to connect the files
@RaddyDev Жыл бұрын
What files are you struggling to connect?
@KenHenricKubota-d9r Жыл бұрын
hello i like the video it is very informative and easy to understand i copied your code(if you don't mind) and made changes i added username, password and address and it was perfect now there is one thing left whenever i try to GET the page on insomnia it displays the HTML page not the JSON what changes do i need? to make it appear just JSON and not HTML also i cannot POST, PATCH, DELETE help.....
@RaddyDev Жыл бұрын
Hi Ken, yeah I don't mind. Do whatever you want with the code... Instead of `res.render` you can just swap it to `res.json` and pass the data inside. That would make it like an API
@gamingfreaks3639 Жыл бұрын
Bro pls do full web app development using ejs mongodb and express😊
@RaddyDev Жыл бұрын
I made a Notes app recently using Ejs, MongoDB, Express and Google Authentication. Is there anything specific that you have in mind?
@KevinArnandes Жыл бұрын
I cannot solve. flash is not function
@RaddyDev Жыл бұрын
Have you tried moving your "app.use(flash({ sessionKeyName: 'flashMessage' }));" before the routes. So you have Flash, Templating Engine and Routes
@walla296 Жыл бұрын
@@RaddyDev I encountered same problem as Kevin and I moved "app.use(flash({ sessionKeyName: 'flashMessage' }));" before Templating Engine and Routes like you said, but I'm still getting same error. What else could we try to solve that?
@agahir Жыл бұрын
@@walla296 do the following : npm uninstall express-flash-message npm i express-flash-message@2.1.0 i.e. uninstall and reinstall version 2.1.0 This should now work :)
@zahlan1936 ай бұрын
Nodemon app crashed, what does it mean
@RaddyDev6 ай бұрын
When did it start to crash. Could be a typo/error in your code
@nationbuilder260 Жыл бұрын
please can you make the final year project for me write a code of final year project Automation System in node and mongo db with student, advisor and admin panel and made responsive using html and css
@RaddyDev Жыл бұрын
Your final year project is for your to build and learn. This tutorial is a great starting point. It's tough, but nothing good comes easy - to most of us anyway 😀
@ochogwuemmy8171 Жыл бұрын
I was enjoying the video until 1:16:30. Flash is not a function spoilt everything have tried all means to solve it including updating and none work
@govindpvenu Жыл бұрын
do the following : npm uninstall express-flash-message npm i express-flash-message@2.1.0
@ochogwuemmy8171 Жыл бұрын
I was able to solve it by placing Flash middleware ahead of session.... It was due to middleware orderliness
@ochogwuemmy8171 Жыл бұрын
I could not host the app it shows 502 error... What could be the problem
@aabbaayy Жыл бұрын
are you working in a company or still learning??? please replay
@RaddyDev Жыл бұрын
I am self-employed
@aabbaayy Жыл бұрын
@@RaddyDev🙌❤️
@josephemmanuel2584 Жыл бұрын
am getting an empty object
@RaddyDev Жыл бұрын
Have you got data in your database? Make sure that you are selecting the correct table. Check for typos
@josephemmanuel2584 Жыл бұрын
@@RaddyDev have not connected to database yet...trying to console.log(req.body)
@josephemmanuel2584 Жыл бұрын
@@RaddyDev its working now🥳🥳🥳🥳🥳🥳 the enctype="multipart/form-data" was the issue pls can you do a video on how to submit a form with image to mongodb....if possible as a continuation of this video
@elayabarathi2003Ай бұрын
Doesn't Work I wasted 3 hrs watching this waste
@RaddyDevАй бұрын
Sorry to hear that you are having trouble with the tutorial. Unfortunately NodeJs packages change and sometimes you just need to Google the errors to get them fixed. If there is anything I can help with, let me know.
@GaneshGadamsetty Жыл бұрын
Hi...at 42 mins, i couldnt connect to database. it shows error .pls help cause: Error: connect ETIMEDOUT 13.234.201.253:27017 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1187:16) { errno: -4039, code: 'ETIMEDOUT', syscall: 'connect', address: '13.234.201.253', port: 27017 }, connectionGeneration: 1, [Symbol(errorLabels)]: Set(1) { 'ResetPool' }
@RaddyDev Жыл бұрын
Are you trying to connect to a remote host? It's gonna be something to do with your hosting settings there. Does it allow remote connection? Does that error come when you publish your project on the same server?
@haider0315 Жыл бұрын
hi msr (Error: No default engine was specified and no extension was provided. at new View (E:\NodeJs_User_Management ode_modules\express\lib\view.js:61:11) at Function.render (E:\NodeJs_User_Management ode_modules\express\lib\application.js:587:12) at ServerResponse.render (E:\NodeJs_User_Management ode_modules\express\lib esponse.js:1039:7) at res.render (E:\NodeJs_User_Management ode_modules\express-ejs-layouts\lib\express-layouts.js:77:18) at E:\NodeJs_User_Management\app.js:22:5 at Layer.handle [as handle_request] (E:\NodeJs_User_Management ode_modules\express\lib outer\layer.js:95:5) at next (E:\NodeJs_User_Management ode_modules\express\lib outer oute.js:144:13) at Route.dispatch (E:\NodeJs_User_Management ode_modules\express\lib outer oute.js:114:3) at Layer.handle [as handle_request] (E:\NodeJs_User_Management ode_modules\express\lib outer\layer.js:95:5) at E:\NodeJs_User_Management ode_modules\express\lib outer\index.js:284:15)
@RaddyDev Жыл бұрын
It looks like you haven't set a View Engine - EJS. You need to add 'app.set('view engine', 'ejs');' in the 'app.js' file somewhere around my comment 'Templating Engine'. It's around the middle of the document (line 41)
@haider0315 Жыл бұрын
Thank you teacher the problem has been solved I had an error in the code@@RaddyDev
@CodexOdyssey Жыл бұрын
your flash is error
@RaddyDev Жыл бұрын
You are getting an error? If so, what does it say? I'll be happy to help
@govindpvenu Жыл бұрын
do the following : npm uninstall express-flash-message npm i express-flash-message@2.1.0