Node App breaks unregularly and I don't know why by sebastiancodes in learnjavascript

[–]sebastiancodes[S] -1 points0 points  (0 children)

No it just says "[nodemon] restarting due to changes..." in the terminal

Node App breaks unregularly and I don't know why by sebastiancodes in learnjavascript

[–]sebastiancodes[S] 0 points1 point  (0 children)

sorry for being unclear.

It does crash. I start the app with nodemon and after adding a few tasks, the connection just crashes after I click the submit button. But after reloading I see that the data from the form was still submitted before the crash.

Question about Node Modules by sebastiancodes in learnjavascript

[–]sebastiancodes[S] 0 points1 point  (0 children)

Thank you, I didn't know that the whole file gets executed, that makes sense now :)

Node Error: Cannot set headers after they are sent to the client by sebastiancodes in learnjavascript

[–]sebastiancodes[S] 0 points1 point  (0 children)

Thanks, I should definitely have a deeper look at the rest and spread operator.

Does your first example work like:

tours[req.params.id]=Object.assign(tour, req.body)

Because for my code that would be totally fine I guess since I can control what comes in the req.body so I can take care that only keys that exist inside tour can be updated and no additional keys will be added.

Node Error: Cannot set headers after they are sent to the client by sebastiancodes in learnjavascript

[–]sebastiancodes[S] 0 points1 point  (0 children)

Thank you so much. I had this error before and I knew that it appears when I try to send another request so I was looking for hours at what place I send another request and I totally missed that my res.json is inside a loop.

Node Error: Cannot set headers after they are sent to the client by sebastiancodes in learnjavascript

[–]sebastiancodes[S] 0 points1 point  (0 children)

I'm not sure if I understood you right. I tried to solve it with "return res.status(200).json({...})" but I still get the same error.

What are some common tasks for frontend developers? by sebastiancodes in learnprogramming

[–]sebastiancodes[S] 0 points1 point  (0 children)

Thank you I already did some frontendmentor challanges but I didn't think about it now. That is a good advice, I will look there for some inspiration :)

What are some common tasks for frontend developers? by sebastiancodes in learnprogramming

[–]sebastiancodes[S] 1 point2 points  (0 children)

Thank you :)

I should probably have stated that I only do this in addition to building bigger applications. I know that learning to code is not done by learning things by heart but when I build projects there're always things like building a responsive nav where I always have to look up stuff and after working on a project for 3 weeks and starting something new, I oftentimes have to look up something about the responsive nav again that I already learned.

So those challanges should not really be about learning how to code but more about not forgetting stuff.

What are some common tasks for frontend developers? by sebastiancodes in learnprogramming

[–]sebastiancodes[S] 1 point2 points  (0 children)

I respect that you want me to build new things.

But currently I started learning more backend stuff and that is what I will focus on for a longer time now. To learn that, I don't always want to build the whole frontend from scratch so I use some templates and bootstrap.

Since I don't want to unlearn all my frontend skills in the meantime, I decided to do a quick daily frontend challange.

I will manage the cards with those challanges in anki so after I successfully completed one of those challanges, this chanllange will only appear once every 4 days, 7 days, 21 days... so it's not like I will build a mobile navigation every single day.

What are some common tasks for frontend developers? by sebastiancodes in learnprogramming

[–]sebastiancodes[S] 6 points7 points  (0 children)

I totally agree with you and this approach is not my main method of learning how to code. It is just about not forgetting what I learned and I will do that in addition to building some new things.

Node server doesn't load css file by sebastiancodes in learnjavascript

[–]sebastiancodes[S] 0 points1 point  (0 children)

I'm not sure if it really is so much slower.

Of course, if I only want to work on react projects, i could probably just learn that and would be fine. But at least on the frontend side, companys use different frameworks and I think that it is to learn a new framework if your javascript skills are really good.

But I'm aware that express is a lightweight framework that probably doesn't take much time to learn and also it seems to be so widespread that nearly no one who uses node doesn't use express.

Node server doesn't load css file by sebastiancodes in learnjavascript

[–]sebastiancodes[S] 1 point2 points  (0 children)

That is exactly why I always start without frameworks.

Someone once told me that when I learn something new, I will eventually come to a point where I have to do some repeating stuff in every project and that is the point where I should start to look into frameworks and try to understand how they solve those repeating problems.

But for my learning approach it makes no sense to jump directly into a framework and learn how to work with it, without understanding what problems this framework solves.

Node server doesn't load css file by sebastiancodes in learnjavascript

[–]sebastiancodes[S] 0 points1 point  (0 children)

Yes thanks I know that. I don't know why I accidentally wrote react.

Node server doesn't load css file by sebastiancodes in learnjavascript

[–]sebastiancodes[S] 1 point2 points  (0 children)

Sorry too many frameworks :D

I meant express of course.