How to hide console error messages in Angular JS?
My web apps is works, no bug!!!! but it has a lot of error message in console.
thanks
Update: I just fix my bug, but this bug can't fix.............anyidea...THX
It looks like most of the errors you show in your screenshot stem from the same issue - namely, attempting to call .length on an object that does not exist.
If you expect the object to not exist sometimes, then you should fix the source of that error with something like:
if (object.length) { ... do something with .length property ... }
Errors should not be ignored! They're our only window into understanding when our programs are not behaving as we intend.
Related
All the React errors and warnings in my electron project look like this:
"Warning: Invalid event handler property `%s`. Did you mean `%s`?%s", source: webpack:///./node_modules/react-dom/cjs/react-dom.development.js? (506)
What would be causing this? Is something misconfigured? I'm not sure what to change. Tagged this four ways because I'm not sure where the issue lies.
Well, if you check the actual dev tools instead of the console, the issue isn't present there. Best I found.
So I'm getting the following error:
Uncaught Error: Assertion Failed: The key provided to get must be a string, you passed undefined
Should be easy enough to fix, if there was any indication of the line in my code that causes that error.
Using the chrome console, I click on ember.debug.js:6254 next to the error, which just shows me the ember code that throws the error. I can expand the error, but I just get a bunch of functions that can't be clicked on and no indication where they come from.
Can someone please help me figure out how to identify the line in my Ember code that is causing the error.
I've gotten this error before. It happens when you call get() in any of its forms (Ember.get() or this.get() or get(this)) without a string as the name of the property you want to retrieve.
You should be able to find the source of the error by auditing your application for wherever you call get() and making sure you pass the property name as a string. E.g., Ember.get('model.someProp') or this.get('someProp') or get(this, 'someProp').
This should be a comment but I can't, so here goes:
Iam new to Ember and have been spending quite a long time debugging. Remember that long stack of function calls that chrome's console shows.
Look for anything other than ember.debug.js...especially those marked (anonymous function) and files with names vendor.js or app-name.js
Usually in software development when debugging your best friends are going to be console.log() or alert() (in the case of JavaScript). Usually you have to figure out if your getting what ever is that you passing to your function by consolelog everything until you find your bug. Ember sometimes will not tell you what is exactly the error because does not know where exactly is coming from.
...computers are annoying but we love them....
here are some articles from Mozilla developer and Google on how to debug JavaScript.
I had a NULL value in my database which I wasn't accounting for in my app. In my case, it shouldn't have been NULL in the first place, so after giving the record a value in my database the problem disappeared.
I agree the error message is not very helpful.
https://node-defender.herokuapp.com/
Is there a way to get meaningful feedback? I'm getting an error that doesn't make sense and I want to check that the function I made is actually returning a mob object instead of "undefined", which it shouldn't be.
Console.error isn't showing up in the console on the right when I run my code. Is there another way to get meaningful feedback from my code so that I can debug it?
It's probably easier/quicker to do the console.log or console.error and look at the actual browser console instead of relying on the in-game console.
I am having problems finding the solution to two errors on a web site I am building on a Joomla 3.0.2 platform and using the Gantry Framework.
The first error is:
Type issue
'null' is not an object (evaluating 'b.appendChild')
The second error is:
Type issue
'undefined' is not an object (evaluating 'rikgallery_slideshow.jump')
I have never understood how to debug javascript errors, so I would really appreciate some help.
The site can be accessed at: http://lads.ergonomiq.net
If someone can help and needs super user access to the back end, please email me at ali.samii#ergonomiq.net
Thanks
This is meant to simply point you in the right direction, further testing will be required to fully solve your issues.
OK the first error is happening in responsive.js line 66
menu.inject(document.getElement('.menu-block'));
I would console.log(menu, document.getElement('.menu-block')) make sure both contain an element as expected. I am guessing one of those will be null.
Second error
AjaxURL: 'http://lads.ergonomiq.net//index.php?option=com_roksprocket&task=ajax&format=raw&ItemId=101'
is returning unexpected JSON
{"status":"error","message":"Unable to find class for item ","payload":null}
I would test the error and only proceed if you have images in your returned JSON
Line 136 of your home page.
Hope this helps
I have never understood how to debug javascript errors, so I would
really appreciate some help.
If you want to debug JavaScript errors, you should be using FireBug with the FireFox browser. You can get the FireBug Add-on here. You will then be able to find these bugs yourself.
Our company site has a JavaScript problem that I'm desperately trying to solve, but really struggling with. My JS skills are good enough to build a site with things like jQuery, but I am not that proficient in debugging - so really appreciate any help.
Seemingly randomly, all JS components (e.g. a jQuery Datepicker) on the page stop working. When force-reloading the page with the error console open, these errors happen about 60% of the time - there doesn't seem to be any pattern to it. The only way to fix the site once this happens is by clearing the cache and reloading.
The Console outputs the following:
Uncaught TypeError: Object #<Object> has no method 'each'
Uncaught TypeError: Object #<Object> has no method 'not'
Uncaught TypeError: Object #<Object> has no method 'each'
However: that's just one example. Other times I will get completely different errors. E.g. a few minutes after submitting this question, I tried again, and got this:
Uncaught TypeError: Cannot call method 'apply' of undefined
Which again was thrown from jquery.min.js - pretty-printed, line 1453 (third line down):
if (g.call(k) === "[object Array]")
if (!u)
e.push.apply(e, k);
I set Chrome to break on all unhandled exceptions, and this was another exception it caught - on line 3 of the minified jQuery library. Shown below is the pretty-printed version:
try {
b.call(c.documentElement, "[test!='']:sizzle")
} catch (f) {
e = !0
}
The actual erroring line begins b.call[...]. This works out to line 1904 of jquery.min.js.
I am using the latest jQuery
This only started happening recently - after changing nothing!
The errors happen seemingly randomly
Usually (but sometimes), no errors are thrown from my scripts - e.g. script.js - usually they are thrown from a minified library. It varies each time.
This seems to happen in all browsers, but more often in Chrome than Firefox
Any ideas where to begin? Unfortunately this is an internal corporate website so providing access is tricky, as we deal with sensitive data throughout the site.
Thank you for your help!
Seems to me that your page is quite big and the browser tries to execute the js code before the DOM loads completely... probably because you're using in-line javascript code..
That could explain the random errors and the fact that you have errors when you force the reload.
I'd suggest you to put your JS code inside a dom ready event so the js code could be executed without problems..
Hope this helps :)