Debugging in 2017 with Node.js

Поделиться
HTML-код
  • Опубликовано: 23 окт 2024

Комментарии • 37

  • @nidhalbt
    @nidhalbt 6 лет назад +3

    Anytime I'm bored, I watch this. My heart flutters and levitates everytime.

  • @codewithnacho
    @codewithnacho 5 лет назад +2

    "What is beyond the console.log()". That last phrase cracked me up. Also, great presentation Paul. Thanks for sharing!

  • @nagahumanbeingzooofparticl8836
    @nagahumanbeingzooofparticl8836 6 лет назад +3

    Fun Facts: The first known computer bug was a real bug (an insect) stuck in the electronics.

  • @MissMugsS
    @MissMugsS 5 лет назад +1

    Awesome tutorial

  • @gompro
    @gompro 5 лет назад

    Blackbox is really stunning!

  • @ComisarioLobo
    @ComisarioLobo 7 лет назад +6

    Awesome video Paul. Is it posible to have access to all these features if I debug inside vscode?

    • @PaulIrish
      @PaulIrish  5 лет назад

      Don't know! VSCode is pretty powerful, but its interface and feature-set aren't developed by the Chrome DevTools team, so I can't speak to its capabilities. :)

  • @th3d-family778
    @th3d-family778 5 лет назад +1

    wow this video is so imformative for me thank you for sharing

  • @ZubairAhmed1024
    @ZubairAhmed1024 7 лет назад

    Good stuff. I think it will help me get out of the cocoon of the VS Code Debugging Tool. :)

    • @YoloMonstaaa
      @YoloMonstaaa 5 лет назад

      Zubair Ahmed how is the chrome one better?

  • @sadiqg5887
    @sadiqg5887 7 лет назад

    Awesome lecture. Thanks Paul Irish.

  • @December2312
    @December2312 5 лет назад

    Hi friend very nice informative video

  • @achamberz2952
    @achamberz2952 3 года назад

    Did they decide to scrape the BlackBox feature, because I can't find it.

  • @MichaelQuad
    @MichaelQuad 5 лет назад

    how to restart "node server.js" from DevTools, is it possible?

  • @dericbytes
    @dericbytes 5 лет назад

    great video thanks.

  • @iEfimoff
    @iEfimoff 6 лет назад +1

    Where is "Network" tab?

  • @rickdevault2535
    @rickdevault2535 6 лет назад

    Can you come to my house and do this for me. Every time I click on show more it doesn't work, really scratching my head over this. Please help.

  • @MaheshGadagi
    @MaheshGadagi 6 лет назад

    HI Paul , I am trying to debug the application (Node : 9.3.0)
    Before I debug I followed this step
    1)killall node (To kill any existing processes)
    2)Then runnode --inspect-brk app.js
    3) And in app.js I have the express router as below
    const users = require('./routes/users');
    app.use('/users', users);
    4) And in the users.js I have below code
    router.get('/profile', (req, res, next) => {
    res.send("User Profile");
    });
    when set the breaking point at router.get('/profile) line And start the debugging chrome tool the page loads directly with even waiting for debugging, Can you please help here

    • @PaulIrish
      @PaulIrish  6 лет назад

      Mahesh Gadagi I'm assuming you are placing this breakpoint right at the beginning, when devtools first opened and paused? If so, you should pause on the router.get early before the page is requested. A breakpoint on the line below (res.send()) should hit at the actual page request.

    • @MaheshGadagi
      @MaheshGadagi 6 лет назад

      Thanks Paul for the response,
      When I tried to have a breakpoint on the line res.send I'm getting the below error immediately in the console,tough I killed all the node processed and started the new session
      events.js:136
      throw er; // Unhandled 'error' event
      ^
      Uncaught Error: listen EADDRINUSE :::3000
      at Object._errnoException (util.js:999:13)
      at _exceptionWithHostPort (util.js:1020:20)
      at Server.setupListenHandle [as _listen2] (net.js:1379:14)
      at listenInCluster (net.js:1420:12)
      at Server.listen (net.js:1508:7)

  • @blasttrash
    @blasttrash 5 лет назад

    Now I understand why even though people hate Java, it still is popular and still relevant. I dont need to go through all this setup just to debug. In Eclipse, Intellij or STS, debugging a java program works out of the box. Why is it so hard to do the same in nodejs?

    • @YoloMonstaaa
      @YoloMonstaaa 5 лет назад

      blasttrash Node doesn't have an actual ide with proper debugging like VS2019 or eclipse is for c# and Java. It's a dynamic language made for scripting simple website interactions, not making real programs. People are basically misusing JS but it's so popular that the crazy optimized runtimes and tools and libraries have made it usable. The reason nodejs is popular is because webdevs learn JS then don't want to learn a real language for native programs.

    • @blasttrash
      @blasttrash 5 лет назад

      @@YoloMonstaaa I know that. And being a statically typed language means that Java and C# have advantage when it comes to IDE or intellisense etc at the cost of some verbosity.

    • @YoloMonstaaa
      @YoloMonstaaa 5 лет назад

      blasttrash I disagree. I don't think string int or char is more verbose than let and bar. What makes c# code verbose is oop and scope rules, nothing to do with static types.

    • @blasttrash
      @blasttrash 5 лет назад

      @@YoloMonstaaa
      no I dont think so
      AbstractFactorySpringBeanInitializer abstractFactory = new AbstractFactorySpringBeanInitializer();
      with dynamic typed language, you can at least skip the first part. Now scale this to entire code base. Without IDEs or code scaffolding, it'd be a pain to type all this. Thats why for quick prototyping or simple scripting, people use js or python or even groovy. In fact some codebases in java use groovy(spock etc) to write tests since tests are not that business critical hence can be written faster. Note groovy is whats called as optionally typed according to some people. Of course there is a huge gray area in that definition.

    • @YoloMonstaaa
      @YoloMonstaaa 5 лет назад

      @@blasttrash Well no, since C# 3.0 (from ~2007) you can have implicitly assigned static typed variables in that situation, so your example would look like
      var abstractFactory = AbstractFactorySpringBeanInitializer();
      And C# will automatically assign it the right type. It's still statically typed so you have all the advantages from that. I'm sure Java has an alternative, I just happen to use C#. It's actually best practice to use var in C# and styling tools (resharper) actually enforce it. So I think my point stands :)
      Edit- quick Google shows Java also has var keyword added in Java 10 in 2018. Man y'all have been slow to copy C# (11 years! Lol). So we can say that's been a limitation of Java and not because of statically typed programming.

  • @saurabhrayakwar7869
    @saurabhrayakwar7869 5 лет назад

    Great work with this. If anyone wants to checkout more tools to debug and profile NodeJs , please follow this article.

  • @quazijay
    @quazijay 7 лет назад +3

    Hey Paul,
    You're the most interesting and charismatic developer I've ever seen. I've been watching you since 2010. But today is 2017 and you're still speaking about nodejs. Seriously? Machine Learning, Solidity, Blockchain development are not enough interested for you?
    what's wrong with you, man? :)

    • @prokawsarahmed
      @prokawsarahmed 7 лет назад

      Hahaha, nice question.
      Need a reply though :D

    • @dylanhassinger2760
      @dylanhassinger2760 7 лет назад +3

      Node rocks dude. And you can even use it for things like machine learning or blockchain. Food 4 thought

    • @quazijay
      @quazijay 7 лет назад +2

      No man, ML rocks. Once you are interested in knives, then you go hunting. Paul is still talking about how knives are produced from, instead of catching a bear with that knife.

    • @gnsh1987
      @gnsh1987 7 лет назад +5

      I guess some people are more interested in producing better knives than the hunting part ;).. just a personal preference?

    • @UnbearablBear
      @UnbearablBear 7 лет назад +3

      Maybe I should not answer you because you really look like a troll and I feel I am wasting my time but not sure enough:
      I guess you don't deserve a knife if you don't respect the ones that craft them and teach you how to use them properly. Enjoy your bear hunting but let mature people help the others.