Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firefox / Firebug's "console.log" always returns 'undefined' [closed]

Since yesterday, for some reason each time I try to display the console log in Firefox I get an undefined instead:

Enter image description here

I use this tool quite often, and just recently I saw that this is not working anymore. I have seem similar questions on Stack Overflow, but none of them with an answer to fix it.

This is what I have done so far to try fix it. I have already

  • Reinstalled Firebug
  • Reinstalled Firefox

And nothing seems to work. However, when I type "console" and hit the run button I get:

Is it a set up that I have to change?

Enter image description here

like image 528
Manza Avatar asked Jan 30 '17 23:01

Manza


3 Answers

Firebug is no longer being maintained. From getfirebug.com:

The Firebug extension isn't being developed or maintained any longer. We invite you to use the Firefox DevTools instead, which ship with Firebug.next

See also Migration from Firebug guide.

like image 173
Domenic D. Avatar answered Oct 07 '22 21:10

Domenic D.


Further to Domenic D.'s answer, I thought it might help others to give a fuller explanation.

It's showing 'undefined' because that's the return value of the function console.log().

It isn't outputting 'test' into the console because Firebug is no longer maintained and doesn't support the latest versions of Firefox. One of the problems I've noticed as a result of this, is that logging using console.log() doesn't show up in the Firebug console anymore.

Unfortunately (if you are used to Firebug), the solution is to use Firefox's built in developer tools instead.

To load the console using Firefox's built in tools, press ctrl+shift+k. Here, console.log() will work as expected. For example, running console.log('test') as you have above, will output 'test', then undefined (the return value of console.log()).

like image 32
dean3148834 Avatar answered Oct 07 '22 22:10

dean3148834


Keep Firefox and Firebug both tools opened. Do whatever you want in Firebug and the result will appear in the Firefox console.

Enter image description here

like image 1
Sugat Mankar Avatar answered Oct 07 '22 20:10

Sugat Mankar