Hyper error A javascript error occurred in the main process - javascript

Anyone know how i fix that ? enter image description here
I tried removing all plugins and even changed the " shell : ' ' " , to "shell: 'bash.exe'" but the error remains

Related

Namespace change in Google Cast custom sender application

I have an issue with a custom sender/receiver application was written a while back.
We recently merged to the cloud and the sender application which is a simple web page was moved and changed its URL from what it used to be.
http: //sdpc.webpage.com to what it is now https: //webpage.com/sdpc.
Now it appears my messages are not being sent over to the receiver application.
I have the following code to send the message to the receiver:
var applicationID = 'F7000000';
var namespace = 'urn:x-cast:com.webpage.cast.sdpc';
var session= null;
var driverRequest;
function sendMessage(message) {
if (session != null) {
location.reload();
session.sendMessage(namespace, message, onSuccess.bind(this,
"Message sent: " + message), onError.bind(this, "Error: " + message));
// $('messageDiv').set('html', session.sendMessage(namespace, message, onSuccess.bind(this, "Message sent: " + message), onError));
} else {
chrome.cast.requestSession(function(e) {
session = e;
location.reload();
session.sendMessage(namespace, message, onSuccess.bind(this,
"Message sent: " + message), onError.bind(this, "Error: " + message));
// $('messageDiv').set('html', session.sendMessage(namespace, message, onSuccess.bind(this, "Message sent: " + message), onError));
}, onError);
}
}
this all worked before we moved the folder over to what is now it's new location on the cloud. I made sure to change the receiver URL in the developer google console to point to its new location, but no luck. Could the namespace be the issue? It's the only thing I'm not sure about.
I believe the sender to receiver connection isn't even being established because I have code setup for any errors while displaying the image to the chrome cast and I am not seeing anything.
I've looked on the google forums and GitHub but I can't think of anything else that might be causing this issue.
not really sure why this got flagged down without letting me know why.
However I managed to solve my own question in case anyone ever needs it. As it turns out my web page was internal so by changing the url on the developer's google web page the receiver was not able to be reached from the outside world. However as soon as I transferred the project + url to a public facing web page and it worked. It took a couple of hours before it registered but it worked.

Nightwatch JS Report Parsing Problems

I’m running some Nightwatch automated tests, and am having some problems parsing the reports with Jenkins and the nightwatch-html-reporter package.
The assertion in question is (basically checking for an alt tag value on a lot of links):
alts.value.forEach(alt => {
this.verify.notEqual('', alt.value || '', '\nImage URL: ' + src.value + '\nImage Tag: ' + tagName + '\n');
}
And I’m catching several failures in the report that look like this, one after another in the report (probably 10 of them with different url’s):
<failure message="Failed [notEqual]: (
Image URL: https://<url>/bc/wp-content/uploads/blog-placeholder-img.jpg
Image Tag: img
) - expected [0;32m""[0m but got: [0;31m""[0m">Image URL: https://<url>/bc/wp-content/uploads/blog-placeholder-img.jpg
Image Tag: img
at NightwatchAPI.<anonymous> (/workspace/WebsiteLaunchAutomation/custom_commands/verifyImgAltTag.js:13:23)
at processTicksAndRejections (internal/process/task_queues.js:89:5)</failure>
<failure message="Failed [notEqual]: (
Image URL: https://<url>/bc/wp-content/uploads/Cars.jpg
Image Tag: img
) - expected [0;32m""[0m but got: [0;31m""[0m">Image URL: https://<url>/bc/wp-content/uploads/Cars.jpg
Image Tag: img
at NightwatchAPI.<anonymous> (/workspace/WebsiteLaunchAutomation/custom_commands/verifyImgAltTag.js:13:23)
at processTicksAndRejections (internal/process/task_queues.js:89:5)</failure>
My problem is when Jenkins reads the report, it only ever displays the first failure, when I am expecting it to display all the failures in the xml report.
Even worse, the nightwatch-html-reporter stops after the opening failure tag, and doesn’t print the stacktrace, or to the end of the first closing failure tag. Here is a bad example:
<failure message =“some message”> (stack trace and other ignored stuff)</failure>
So my question is, am I doing something to cause it to cut off like this? Can I change anything in the report so either of these tools can parse the report properly? (I’m not normally a javascript dev, I usually do selenium + java, and testng reports have always been fine)

Angular displays url encoded errors, how to get decoded version?

When I have uncaught errors in my angular applications the console message looks like this:
Error: [$injector:modulerr] http://errors.angularjs.org/1.4.3/$injector/modulerr?p0=app&p1=%5B%24injector%3Aunpr%5D%20http%3A%2F%2Ferrors.angularjs.org%2F1.4.3%2F%24injector%2Funpr%3Fp0%3DENVIRONMENT%0AJ%2F%3C%40http%3A%2F%2Flocalhost%3A8600%2Flibs.js%3A11%3A416%0Aeb%2Fr.%24injector%3C%40http%3A%2F%2Flocalhost%3A8600%2Flibs.js%3A45%3A375%0Ad%40http%3A%2F%2Flocalhost%3A8600%2Flibs.js%3A43%3A364%0A%40http%3A%2F%2Flocalhost%3A8600%2Fapp%2Fapp.js%3A42%3A18%0Ae%40http%3A%2F%2Flocalhost%3A8600%2Flibs.js%3A44%3A154%0Ad%40http%3A%2F%2Flocalhost%3A8600%2Flibs.js%3A42%3A320%0Ag%2F%3C%40http%3A%2F%2Flocalhost%3A8600%2Flibs.js%3A42%3A452%0Am%40http%3A%2F%2Flocalhost%3A8600%2Flibs.js%3A12%3A320%0Ag%40http%3A%2F%2Flocalhost%3A8600%2Flibs.js%3A42%3A229%0Aeb%40http%3A%2F%2Flocalhost%3A8600%2Flibs.js%3A45%3A1%0AAc%2Fd%40http%3A%2F%2Flocalhost%3A8600%2Flibs.js%3A24%3A339%0AAc%40http%3A%2F%2Flocalhost%3A8600%2Flibs.js%3A25%3A151%0AZd%40http%3A%2F%2Flocalhost%3A8600%2Flibs.js%3A23%3A464%0A%40http%3A%2F%2Flocalhost%3A8600%2Flibs.js%3A294%3A428%0An.Callbacks%2Fj%40http%3A%2F%2Flocalhost%3A8600%2Flibs.js%3A2%3A26920%0An.Callbacks%2Fk.fireWith%40http%3A%2F%2Flocalhost%3A8600%2Flibs.js%3A2%3A27738%0A.ready%40http%3A%2F%2Flocalhost%3A8600%2Flibs.js%3A2%3A29530%0AI%40http%3A%2F%2Flocalhost%3A8600%2Flibs.js%3A2%3A29721%0AnrWrapper%40http%3A%2F%2Flocalhost%3A8600%2F%23%2Fdashboard%3A15%3A12749%0A
Which is not useful, but if I url_decode it it is much better, like this:
http://errors.angularjs.org/1.4.3/$injector/modulerr?p0=app&p1=[$injector:unpr] http://errors.angularjs.org/1.4.3/$injector/unpr?p0=ENVIRONMENT
J/<#http://localhost:8600/libs.js:11:416
eb/r.$injector<#http://localhost:8600/libs.js:45:375
d#http://localhost:8600/libs.js:43:364
#http://localhost:8600/app/app.js:42:18
e#http://localhost:8600/libs.js:44:154
d#http://localhost:8600/libs.js:42:320
g/<#http://localhost:8600/libs.js:42:452
m#http://localhost:8600/libs.js:12:320
g#http://localhost:8600/libs.js:42:229
eb#http://localhost:8600/libs.js:45:1
Ac/d#http://localhost:8600/libs.js:24:339
Ac#http://localhost:8600/libs.js:25:151
Zd#http://localhost:8600/libs.js:23:464
#http://localhost:8600/libs.js:294:428
n.Callbacks/j#http://localhost:8600/libs.js:2:26920
n.Callbacks/k.fireWith#http://localhost:8600/libs.js:2:27738
.ready#http://localhost:8600/libs.js:2:29530
I#http://localhost:8600/libs.js:2:29721
nrWrapper#http://localhost:8600/#/dashboard:15:12749
How can I get angular to output errors this way by default? Thanks.
It's url encoded because it's a link. Click it! :D
It will bring you to a webpage that explains the error.
This is your error
If you go to that page and look at the error it will say that it threw an error because of x error. Then that error will be a link to, so click that as well.
And now that you've gotten to that last page, the error is that you have an unknown provider called ENVIRONMENT.
You can override exception handler:
angular.module('exceptionOverride', []).factory('$exceptionHandler', function() {
return function(exception, cause) {
exception.message += ' (caused by "' + cause + '")';
throw exception;
};
});
More here

show line numbers for console statements in IE 9 debugger

I hope this is something simple..
I am using the F12 Development tool debugger in IE 9. Is there a way I can display the line numbers and file source for each console statement, the same way that Firebug displays this info? I may have overlooked something basic, but I haven't yet found a way to do this..Thanks!
The only way to get line numbers is to define a window.onerror method:
window.onerror = function (message, url, lineNo)
{
console.log('Error: ' + message + '\n' + 'Line Number: ' + lineNo);
return true;
}
console.log(window);
console.log(1=2);
But even then, IE breaks on the error, so it's rather useless.

Retrieving the line number from an Internet Explorer error object

Is there a way to retrieve the line number from an Internet Explorer 7/8 error object?
I'm only aware of the .message, .description and .number properties.
I've searched around a bit and found an MSDN article on .stack ( http://msdn.microsoft.com/en-us/library/hh699850(v=vs.94).aspx ), but even using their own example code doesn't return a line number:
http://jsfiddle.net/LWevS/
I dug around some more and found that it is possible to retrieve the line number in IE using window.onerror. It's not from the Error object itself, but it's a decent workaround:
function BadFunction(){
This.badcode.willnot.work = 1000
}
function ForceError(msg, url, lno) {
alert("Error Occurred! Handled by Generic Error Handler" + "\n" +
"Error: " + msg + "\n" + "URL: " + url + "\n" +
"Line Number: " + lno);
return true;
}
window.onerror = ForceError;
This method requires that the error bubble up to the window. If you have a try/catch in your code, you will need to re-throw the error so it can bubble up.
I also came across StackTraceJS on GitHub while researching a solution to this problem. Their stack tracing script works great on all browsers except for Internet Explorer. A great run-time debugger if you want to log errors produced on the client browser.
http://stacktracejs.com/

Categories