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
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PDF
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
PPT
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PDF
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
PPTX
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PDF
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PPTX
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 

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.