Javascript error on Magento - Registry Undefined - javascript

We have a JavaScript error on our website (http://www.sointeriors.co.uk) and we are experiencing frequent add to cart errors which may or may not be associated with the error but either way we need it fixing so we can rule it out as causing the add to cart error.
Anyway I'm not good with JavaScript, the error in Firebug is as follows:
Error
TypeError: registry is undefined ... line 540 of hello.jquery.js
Code
var respondersForEvent=registry.get(eventName);
if(Object.isUndefined(respondersForEvent)){
respondersForEvent=[];
registry.set(eventName,respondersForEvent);
}
Does this error mean anything to someone who knows JavaScript or can anyone tell me what needs to be done to correct this? It's appearing on every page of the website.

Related

Javascript error when running on different pages

I have a standalone form. My issue is when I run the form standalone it runs fine but when the form code is included in some other page where it is supposed to be displayed it shows
Uncaught TypeError: Cannot read property 'value' of undefined at submit:10
I have tried debugging it from last few hours but still not able to find the exact issue. could someone please point out where the mistake might be. It could be some small error but it will be really helpful if you could point it out.
Both the forms are these: Standalone form and form included in a page
The moment you load your page you will see an error:
Uncaught ReferenceError: field is not defined
That is because field is defined here:
https://simrec.custhelp.com/rnt/rnw/javascript/enduser.js
which is not included in the other page. You are using new field() in your code without having it defined. Fix that and the rest could work if it's working in the standalone form.

debugging javascript console error

I just got some big project and with error in console. there are many more than scripts used at that page but error shows very little information. there are 25 scripts loading at page. To give you an idea how many scripts they are you can see. :(
I have error in console but i can't find which original file, line number causing it. the error showing are in library. but i know it's not library bug it's caused by some other script. but this stack trace is very small. is there any tool or any other way where i can originally find from where it is originating.
let me know if further information is required.
If you click on link "amstock.js" you will be redirect to that file and directly in the line that was causing the error. Always the upper file is which causes the problem, but some times because of a previous one.
In adition, the error maybe cause by an asynchronous call that leaves your variable in null and fill it after the line of the error was call, or just you are trying to access a wrong variable. Check that line.

Dynamic java script zoom error in vb.net project

I inherited a legacy VB.net project that always has the following error:
document.body.style.zoom = screen.logicalXDPI / screen.deviceXDPI;
The exact error message from VIsual Studio is as follows:
JavaScript runtime error: Unable to get property 'style' of undefined or null reference
I have searched the entire solution, but none of the relevant variables/attributes show up.
I assume this is a javascript or jquery problem, the debugger says that it is a script block [dynamic] and the Call Stack says that it is global code.
Has anyone seen this error before?
Please help. Thanks in advance.
Believe it or not, removing add-ins in the browser did the trick (thanks to a colleague). It's not in the code-base at all in this case. The specific culprit was a MacAfee add-in. I never would have guessed this.

Angularjs Error Logging

Currently using the stacktrace.js for logging all my errors in my Angularjs app as below
app.factory('$exceptionHandler', ['errorLogService',function (errorLogService) {
return function (exception, cause) {
errorLogService.log(exception.message, cause);
};
}
]);
this service will log every error occurred in my app. My question is, can we choose certain types or levels of errors to be logged? I'm pretty sure that I'm logging every damn thing! which is causing a lot of headaches..
AFAIK stacktrace.js has no feature to specify certain types or levels of errors to be logged. That is because JS has no standard error type or error level. A script error is an error - that's all! Having said that - problem seems to be in your coding style. Why should there be so many errors thrown in JS code? So many errors in JS code will clutter the whole console and make the logging useless. Only solution I can think of is to fix the errors so that the logs get cleaner. There should be zero such errors in console before you go live - if you have tested your code properly.

Uncaught ReferenceError: chrome_fix3 is not defined _cmp_execLogic._cmp_suclick

I am getting the following error. How can I resolve this?
Uncaught ReferenceError: chrome_fix3 is not defined
_cmp_execLogic._cmp_suclick
Good news - the error is nothing to do with your site.
Bad news - it's caused by an erroneous browser extension that's injecting invalid javascript into your pages. I have an ever increasing list of similarly caused errors that we can do nothing other than trap and ignore. At some point I intend to feed a message back to the user that something they have installed may cause problems on our sites, but ideally I'd like to tell them exactly what extension is causing the issue, which I don't know in all cases.
If anyone knows where the attempt to reference "chrome_fix3" actually comes from, please add to this post.
A similar error that we trap but is nothing to do with our code is:
Uncaught ReferenceError: conduitPage is not defined
I found the following pages helpful when investigating the error:
https://webmademovies.lighthouseapp.com/projects/65733/tickets/2895-crash-referenceerror-conduitpage-is-not-defined
http://www.youtube.com/user/conduityoursite#g/c/4B820DE13E03888D
Your code tries to refer to a variable or property that does not exist, in your case it's named chrome_fix3.
This probably came from a javascript libary that you are using, maybe jQuery or something.
I assume that the library is fine and it's caused by wrongfully calling some of it's functions.
The best way now is to install the Firebug plugin in Firefox (you could use Chrome, Opera or Internet Explorer's debugger but I like Firebug best)
Then add following code in your code where you think it's going wrong:
//add the following line only once:
var okCounter=0;
// add teh following line every couple of lines in your code:
console.log("still ok here:",okCounter++);
Open your page in Forefox and hit F12, the Firebug window should show up now. Reload the page and check out the console tab.
At some point you should notice there is no more output to the console where there should be; now you have found the part in your code where something goes wrong. If you post that part we might be able to help you out more.

Categories

Resources