Search code examples
javascriptjsfiddle

How do I find errors in jsfiddle?


I love jsfiddle and lately I've been learning javascript. There are of course many errors as I learn but I haven't figured out how to read error codes from console.

Latest I have is "1182:12 Uncaught TypeError: Cannot read property 'style' of null"

Each section of my code is less than 1000 lines of code, but clearly combined it's more. Is there a way to use this info to find where the error is happening?

TIA!


Solution

  • The console should show you an underlined section where the line number is that you can click:

    enter image description here

    The line number does not correspond to the line number in the JSFiddle code editor, but it'll take you to the error location in the browser's Sources panel:

    enter image description here

    This problem is not specific to JSFiddle. Many online code editors without integrated consoles have this issue, and this solution should work in most of them.