SlideShare a Scribd company logo
Web a Quebec - JS Debugging
Web a Quebec - JS Debugging
• Types of Errors in JavaScript
• Frequent Locations of Errors in JavaScript
• Debugging and Introspection Tools
• Remote Debugging Node Processes
• Remote Debugging Front-End JavaScript
Web a Quebec - JS Debugging
Web a Quebec - JS Debugging
• Loading Errors
• E.g. Incorrect syntax, minification errors, network-related errors,
missing files, etc.
• Runtime Errors
• E.g. Syntax errors, misspelled variables, illegal assignment,
variables/classes don’t exist, etc.
• Logic Errors
• E.g. BUGS! But also errors due to format and parameters (JSON vs
XML), etc…
Web a Quebec - JS Debugging
Web a Quebec - JS Debugging
Web a Quebec - JS Debugging
Web a Quebec - JS Debugging
DEMOS!
• Using this wrong an scoping errors
• Accidentally creating memory leaks
• Dangling references to unused objects
• Circular references
• Incorrect coercion, comparisons and equality
• Incorrect references to instance objects & prototypical
inheritance errors
• So much more…
• Allow you to control execution and walk through line-by-line
• Debug with breakpoints to conditionally stop execution
• Examine the call stack
• Pause on exceptions
• Stack trace exceptions
https://gist.github.com/sayar/3ffa68c1765b8e6d78e0
• Node Inspector supports almost all of the debugging features
of the Blink DevTools, including:
• Set breakpoints (and specify trigger conditions)
• Step over, step in, step out, resume (continue)
• Inspect scopes, variables, object properties
• Edit variables and object properties
• Break on exceptions
• Network client requests inspection
• Console output inspection
• Other cool stuff:
• Node Inspector uses WebSockets, so no polling for breaks.
• Remote debugging
• Live edit of running code, optionally persisting changes back to the file-
system.
• Set breakpoints in files that are not loaded into V8 yet - useful for
debugging module loading/initialization.
• Embeddable in other applications
npm install -g node-inspector
node-debug app.js
• Code supports all the typical debugging features including:
• Set breakpoints (and specify trigger conditions)
• Step over, step in, step out, resume (continue)
• Inspect scopes, variables, object properties
• Edit variables and object properties
• Break on exceptions
• Remote debugging
• With Node-ChakraCore and Code -> Time Travel Debugging
Web a Quebec - JS Debugging
Visual Studio Code is free and runs on Linux/OSX/Windows.
Node-ChakraCore is on GitHub (Still Beta).
Demo Instructions on GitHub.
Web a Quebec - JS Debugging
Web a Quebec - JS Debugging
Web a Quebec - JS Debugging
Pass --debug flag to node process
$ node --debug app.js
Or on OSX/Linux…
$ pgrep -l node
2345 node your/node/server.js
$ kill -s USR1 <PID>
• With built-in node debugger:
$ node debug localhost:5858
• With node-inspector:
$ node-inspector
• With Visual Studio Code
• Use Attach launch setting, debug… 
Web a Quebec - JS Debugging
Vantage = CLI + SSH + REPL for your live node app
Who hasn’t heard that one or a variant before?
Wait… what! You can do that?
Web a Quebec - JS Debugging
• An open source, extensible, platform-agnostic tool for remotely
debugging and testing your JavaScript.
• Plugins:
• Console: View logs and errors for your application.
• Modernizr: View a list of supported and unsupported features.
• DOM Explorer: Inspect the DOM tree and its corresponding styles.
• Object Explorer: Display the living JavaScript variables tree.
• XHR Panel: View XHR calls information sent by your devices.
• ngInspector: Inspect your Angular.js scopes
• Network Monitor: View network activities (XHR & resources loading).
• Resources Explorer: Inspect local resources such as localStorage or cookoes.
$ npm install -g vorlon
$ vorlon
Add to your code.
<script src="http://localhost:1337/vorlon.js"></script>
Open http://localhost:1337
• Deploy Vorlon.JS to a public server/PaaS/wtv.
• As simple as a git push
• Add this to your public beta website:
<script src="http://mywebsite.com/vorlon.js"></script>
Web a Quebec - JS Debugging
• Types of Errors & Locations in JavaScript
• Debugging and Introspection Tools
• node-inspector
• VS Code
• Remote Debugging Node Processes
• node-inspector, VS Code
• Vantage
• Remote Debugging Front-End JavaScript
• Vorlon.JS
Web a Quebec - JS Debugging
tw: @ramisayar | gh: @sayar
slideshare.net/ramisayar
• http://www.toptal.com/javascript/10-most-common-javascript-
mistakes
• https://developers.google.com/web/tools/javascript/breakpoints/
• http://www.w3schools.com/js/js_debugging.asp
• http://www.webreference.com/programming/javascript/rg31/index.h
tml
• http://eloquentjavascript.net/08_error.html
• http://www.pluralsight.com/courses/fixing-common-javascript-bugs
• https://trackjs.com/
• http://www.standardista.com/javascript/15-common-javascript-
gotchas/
©2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Office, Azure, System Center, Dynamics and other product names are or may be registered trademarks and/or trademarks in the
U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft
must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after
the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

More Related Content

What's hot (20)

PPTX
Saving Time By Testing With Jest
Ben McCormick
 
PDF
Building modular applications with the Java Platform Module System and Layrry
Andres Almiray
 
PDF
Laravel Introduction
Ahmad Shah Hafizan Hamidin
 
PPTX
Agile sites @ telmore
Michele Sciabarrà
 
PDF
What I wish I knew about maven years ago
Andres Almiray
 
PPTX
Agile sites2
Michele Sciabarrà
 
PPTX
Laravel overview
Obinna Akunne
 
PPTX
ASP.NET Core 1.0
Ido Flatow
 
PDF
Agile sites311training
Michele Sciabarrà
 
PDF
Taking Micronaut out for a spin
Andres Almiray
 
PPTX
SenchaCon 2016: The Modern Toolchain - Ross Gerbasi
Sencha
 
PPTX
Laravel Tutorial PPT
Piyush Aggarwal
 
PDF
Laravel presentation
Toufiq Mahmud
 
PPTX
Laravel introduction
Simon Funk
 
PPTX
Introducing ASP.NET Core 2.0
Steven Smith
 
PDF
An Introduction to the Laravel Framework (AFUP Forum PHP 2014)
daylerees
 
PPTX
2011 NetUG HH: ASP.NET MVC & HTML 5
Daniel Fisher
 
PPTX
Powershell For Developers
Ido Flatow
 
PPTX
I18nize Scala programs à la gettext
Ngoc Dao
 
PPTX
Laravel 5
Brian Feaver
 
Saving Time By Testing With Jest
Ben McCormick
 
Building modular applications with the Java Platform Module System and Layrry
Andres Almiray
 
Laravel Introduction
Ahmad Shah Hafizan Hamidin
 
Agile sites @ telmore
Michele Sciabarrà
 
What I wish I knew about maven years ago
Andres Almiray
 
Agile sites2
Michele Sciabarrà
 
Laravel overview
Obinna Akunne
 
ASP.NET Core 1.0
Ido Flatow
 
Agile sites311training
Michele Sciabarrà
 
Taking Micronaut out for a spin
Andres Almiray
 
SenchaCon 2016: The Modern Toolchain - Ross Gerbasi
Sencha
 
Laravel Tutorial PPT
Piyush Aggarwal
 
Laravel presentation
Toufiq Mahmud
 
Laravel introduction
Simon Funk
 
Introducing ASP.NET Core 2.0
Steven Smith
 
An Introduction to the Laravel Framework (AFUP Forum PHP 2014)
daylerees
 
2011 NetUG HH: ASP.NET MVC & HTML 5
Daniel Fisher
 
Powershell For Developers
Ido Flatow
 
I18nize Scala programs à la gettext
Ngoc Dao
 
Laravel 5
Brian Feaver
 

Similar to Web a Quebec - JS Debugging (20)

PDF
Here Be Dragons – Advanced JavaScript Debugging
FITC
 
PDF
Oracle WebLogic Diagnostics & Perfomance tuning
Michel Schildmeijer
 
PPTX
introduction to node.js
orkaplan
 
PPTX
Badneedles
dimisec
 
PDF
"You Don't Know NODE.JS" by Hengki Mardongan Sihombing (Urbanhire)
Tech in Asia ID
 
PPTX
T4T Training day - NodeJS
Tim Sommer
 
PPTX
VS Debugging Tricks
Sasha Goldshtein
 
PDF
How to Contribute to Apache Usergrid
David M. Johnson
 
PDF
Web Development using Ruby on Rails
Avi Kedar
 
PPT
.NET Debugging Workshop
Sasha Goldshtein
 
PDF
OWASP SF - Reviewing Modern JavaScript Applications
Lewis Ardern
 
PPTX
VorlonJS
Fabrício Catae
 
PPTX
Static Code Analysis: Keeping the Cost of Bug Fixing Down
Andrey Karpov
 
PDF
Building XWiki
Vincent Massol
 
PPTX
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
Speedment, Inc.
 
PPTX
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
Malin Weiss
 
PDF
Infinum Android Talks #13 - Developing Android Apps Like Navy Seals by Ivan Kušt
Infinum
 
PDF
CBDW2014 - MockBox, get ready to mock your socks off!
Ortus Solutions, Corp
 
PDF
Доклад Михаила Егорова на PHDays
ru_Parallels
 
PDF
Hacking Adobe Experience Manager sites
Mikhail Egorov
 
Here Be Dragons – Advanced JavaScript Debugging
FITC
 
Oracle WebLogic Diagnostics & Perfomance tuning
Michel Schildmeijer
 
introduction to node.js
orkaplan
 
Badneedles
dimisec
 
"You Don't Know NODE.JS" by Hengki Mardongan Sihombing (Urbanhire)
Tech in Asia ID
 
T4T Training day - NodeJS
Tim Sommer
 
VS Debugging Tricks
Sasha Goldshtein
 
How to Contribute to Apache Usergrid
David M. Johnson
 
Web Development using Ruby on Rails
Avi Kedar
 
.NET Debugging Workshop
Sasha Goldshtein
 
OWASP SF - Reviewing Modern JavaScript Applications
Lewis Ardern
 
VorlonJS
Fabrício Catae
 
Static Code Analysis: Keeping the Cost of Bug Fixing Down
Andrey Karpov
 
Building XWiki
Vincent Massol
 
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
Speedment, Inc.
 
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
Malin Weiss
 
Infinum Android Talks #13 - Developing Android Apps Like Navy Seals by Ivan Kušt
Infinum
 
CBDW2014 - MockBox, get ready to mock your socks off!
Ortus Solutions, Corp
 
Доклад Михаила Егорова на PHDays
ru_Parallels
 
Hacking Adobe Experience Manager sites
Mikhail Egorov
 
Ad

More from Rami Sayar (9)

PDF
Introduction to React Native
Rami Sayar
 
PDF
FITC - Exploring Art-Directed Responsive Images
Rami Sayar
 
PDF
Creating Beautiful CSS3 Animations - FITC Amsterdam 2016
Rami Sayar
 
PDF
What's New in ES6 for Web Devs
Rami Sayar
 
PDF
Scalable Django Architecture
Rami Sayar
 
PDF
The State of WebSockets in Django
Rami Sayar
 
PDF
FITC - Bootstrap Unleashed
Rami Sayar
 
PDF
FITC - Node.js 101
Rami Sayar
 
PDF
FITC - Data Visualization in Practice
Rami Sayar
 
Introduction to React Native
Rami Sayar
 
FITC - Exploring Art-Directed Responsive Images
Rami Sayar
 
Creating Beautiful CSS3 Animations - FITC Amsterdam 2016
Rami Sayar
 
What's New in ES6 for Web Devs
Rami Sayar
 
Scalable Django Architecture
Rami Sayar
 
The State of WebSockets in Django
Rami Sayar
 
FITC - Bootstrap Unleashed
Rami Sayar
 
FITC - Node.js 101
Rami Sayar
 
FITC - Data Visualization in Practice
Rami Sayar
 
Ad

Recently uploaded (20)

PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
Biography of Daniel Podor.pdf
Daniel Podor
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PDF
July Patch Tuesday
Ivanti
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
Biography of Daniel Podor.pdf
Daniel Podor
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
July Patch Tuesday
Ivanti
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 

Web a Quebec - JS Debugging

  • 3. • Types of Errors in JavaScript • Frequent Locations of Errors in JavaScript • Debugging and Introspection Tools • Remote Debugging Node Processes • Remote Debugging Front-End JavaScript
  • 6. • Loading Errors • E.g. Incorrect syntax, minification errors, network-related errors, missing files, etc. • Runtime Errors • E.g. Syntax errors, misspelled variables, illegal assignment, variables/classes don’t exist, etc. • Logic Errors • E.g. BUGS! But also errors due to format and parameters (JSON vs XML), etc…
  • 12. • Using this wrong an scoping errors • Accidentally creating memory leaks • Dangling references to unused objects • Circular references • Incorrect coercion, comparisons and equality • Incorrect references to instance objects & prototypical inheritance errors • So much more…
  • 13. • Allow you to control execution and walk through line-by-line • Debug with breakpoints to conditionally stop execution • Examine the call stack • Pause on exceptions • Stack trace exceptions
  • 15. • Node Inspector supports almost all of the debugging features of the Blink DevTools, including: • Set breakpoints (and specify trigger conditions) • Step over, step in, step out, resume (continue) • Inspect scopes, variables, object properties • Edit variables and object properties • Break on exceptions • Network client requests inspection • Console output inspection
  • 16. • Other cool stuff: • Node Inspector uses WebSockets, so no polling for breaks. • Remote debugging • Live edit of running code, optionally persisting changes back to the file- system. • Set breakpoints in files that are not loaded into V8 yet - useful for debugging module loading/initialization. • Embeddable in other applications
  • 17. npm install -g node-inspector node-debug app.js
  • 18. • Code supports all the typical debugging features including: • Set breakpoints (and specify trigger conditions) • Step over, step in, step out, resume (continue) • Inspect scopes, variables, object properties • Edit variables and object properties • Break on exceptions • Remote debugging • With Node-ChakraCore and Code -> Time Travel Debugging
  • 20. Visual Studio Code is free and runs on Linux/OSX/Windows. Node-ChakraCore is on GitHub (Still Beta). Demo Instructions on GitHub.
  • 24. Pass --debug flag to node process $ node --debug app.js Or on OSX/Linux… $ pgrep -l node 2345 node your/node/server.js $ kill -s USR1 <PID>
  • 25. • With built-in node debugger: $ node debug localhost:5858 • With node-inspector: $ node-inspector • With Visual Studio Code • Use Attach launch setting, debug… 
  • 27. Vantage = CLI + SSH + REPL for your live node app
  • 28. Who hasn’t heard that one or a variant before?
  • 29. Wait… what! You can do that?
  • 31. • An open source, extensible, platform-agnostic tool for remotely debugging and testing your JavaScript. • Plugins: • Console: View logs and errors for your application. • Modernizr: View a list of supported and unsupported features. • DOM Explorer: Inspect the DOM tree and its corresponding styles. • Object Explorer: Display the living JavaScript variables tree. • XHR Panel: View XHR calls information sent by your devices. • ngInspector: Inspect your Angular.js scopes • Network Monitor: View network activities (XHR & resources loading). • Resources Explorer: Inspect local resources such as localStorage or cookoes.
  • 32. $ npm install -g vorlon $ vorlon Add to your code. <script src="http://localhost:1337/vorlon.js"></script> Open http://localhost:1337
  • 33. • Deploy Vorlon.JS to a public server/PaaS/wtv. • As simple as a git push • Add this to your public beta website: <script src="http://mywebsite.com/vorlon.js"></script>
  • 35. • Types of Errors & Locations in JavaScript • Debugging and Introspection Tools • node-inspector • VS Code • Remote Debugging Node Processes • node-inspector, VS Code • Vantage • Remote Debugging Front-End JavaScript • Vorlon.JS
  • 37. tw: @ramisayar | gh: @sayar slideshare.net/ramisayar
  • 38. • http://www.toptal.com/javascript/10-most-common-javascript- mistakes • https://developers.google.com/web/tools/javascript/breakpoints/ • http://www.w3schools.com/js/js_debugging.asp • http://www.webreference.com/programming/javascript/rg31/index.h tml • http://eloquentjavascript.net/08_error.html • http://www.pluralsight.com/courses/fixing-common-javascript-bugs • https://trackjs.com/ • http://www.standardista.com/javascript/15-common-javascript- gotchas/
  • 39. ©2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Office, Azure, System Center, Dynamics and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.