I am using PhantomJS 2 and the latest CasperJS to test a remote webpage containing some TypeErrors. While logging into the webapp, a popup.created and popup.loaded event are initiated before PhantomJS prints a stacktrace of TypeErrors found when attempting to render the resource. PhantomJS hangs here because PhantomJS does not know how to handle parse errors (Github issue #10687). And my attempts to listen for "error" and "page.error" in both Phantomjs and Casperjs events fail since these TypeError (parse errors) do not throw page.error events (Github issue #10537). I do not own the remote webapp, so I cannot fix these errors. But I need to catch these remote webpage errors and proceed with my testing.
I have unsuccessfully tried to abort loading the resource when the popup.created and popup.loaded events are initiated and I also unsuccessfully attempted to abort the request for the resource when the url of the requested resource matched known url of the .html popup file with TypeErrors. Does anyone know a better way to handle these TypeErrors?
Related
First time using web workers and I get this error when I try to run it.
First I get a very generic error event sent to my worker.onerror handler. It does not have the message property, the only information is the property type which says error.
Looking at the network tab in dev tools, the request for the worker script looks like it succeeds but it only has provisional response headers and no content to preview.
Preview has:
failed to load response data: connection is closed, can't dispatch pending call to Network.getResponseBody
This caused me to waste about an hour searching for web worker errors. Anyway it turns out that you can get this error if you have a syntax error in your Javascript. At least that is what got me.
I've an issue requesting some data in JS and i get status code 503 and also a message that i don't know what it means,it seems like the memory located to the request is not enought and i would like to know why and how to solve, here the screenshot:
You can manually see it on chrome's dev tools (network section) on this page: PAGE
You can also notice that if you refresh the page more times the requests that fails are everytime different.
I won't write all the code here because is too long, but i leave the link, i'm sorry but this is not my own script and it is compressed.
this is the file that triggers the error.
CODE
THIS IS THE ERROR FROM CPANEL:
couldn't create child process: /usr/sbin/suphp for /home/smmmainp/public_html/index.php, referer: https://smm-mainpanel.com/services
I looked up your site and your server is returning an Exceeded Resource Limit Error Show Image.
"The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later".
It is not a JavaScript problem, it is an HTTP Request problem, server-side. The "jQuery" that's showing in your Console is probably the Request Initiator, and when some problem happens with your Request, the jQuery needs to Handle it and send an error message. But stills a Server-Side error.
You need to look into your cPanel, go to "Stats" page and look your HTTP Request Limit, in order to know how much requests daily (or per hour) your server handle. Review your Server Provider Plan and contact them.
Best regards!
I'm trying to use importScripts
self.addEventListener('fetch', event => {
...
self.importScripts('idb.js');
...
}
to load a library for a service worker for a PWA but keep getting
DOMException: Failed to execute 'importScripts' on 'WorkerGlobalScope':
The script at 'http://localhost:3000/idb.js' failed to load.
The script file is there, content type is correct, application/javascript, and I've tried it with text/javascript too. My developer tools network tab shows the request starting and then failing really quickly, not getting a chance to hit the server. The status code is (failed) net::ERR_CONNECTION_REFUSED when over http and (failed) net::ERR_FAILED over https. Any help appreciated
According to https://developers.google.com/web/updates/2018/10/tweaks-to-addAll-importScripts
Prior to Chrome 71, calling importScripts() asynchronously outside of the install handler would work. Starting with Chrome 71, those calls throw a runtime exception (unless the same URL was previously imported in an install handler), matching the behavior in other browsers.
I have to move importScripts to the top level of my file or my install handler and it works
Based upon the link you provided, you are not running under HTTPS. You need a site under HTTPS to use a service worker.
My original post wrong. #kmanzana pointed out that localhost is considered a "secure origin".
Also, if there is an import statement inside any of the scripts on which you are using importScripts(), you will get this error, and it will not immediately be clear why you are getting it. Caveat emptor.
I was suspicious that the issue of seeing console errors "showing HTML as JS files" was caused by my attempt to redirect 404 errors. And then a comment on this reddit post suggested that this was a valid assumption... But how is this possible? By what means does a JS resource become HTML when 404s are redirected?
Application servers usually have default web pages to render HTTP error codes. For instance, these are the Apache 2.4 settings regarding custom error responses.
So, it's normal to get HTML responses for HTTP error codes if your application server is configured as such.
It seems that IE11 version 11.0.7 (KB2929437 on Win7, KB2919355 on Win 8.1) has a problem when performing an Ajax POST operation. The operation returns status 0 and on an F12 console, the following error appears:
SCRIPT7002: XMLHttpRequest: Network Error 0x2ee4, Could not complete the operation due to error 00002ee4.
The conditions to reproduce this issue are as follows:
Happens only on specific IE11, i.e. version 11.0.7 (KB2929437 on
Win7, KB2919355 on Win 8.1)
iframe is used to load external page with https protocol (parent page is using http protocol)
ajax with method 'POST' is used
More frequently happens with Connection: Keep-Alive header set on by IIS
More frequently happens on Win32 version of IE11
I created the following jsfiddle to reproduce this issue: http://jsfiddle.net/VJ2D6/12/
$(document).ready(function () {
$('#frame').attr('src', 'https://54.249.142.247/ie11/test.html');
});
Please note that the iframe retrieves its source from another site 54.249.142.247 (hosted by EC2 node using IIS7), because jsfiddle doesn't host https.
And, because I am using Self-Sign SSL Certificate, please first install the certificate to the Trusted Root, and turn off "Warn about certificate address mismatch" from Internet Options - Advanced Tab.
Inside 54.249.142.247/ie11/test.html, I created a button which initiates an Ajax POST operation to a non-existing location. Normally this request should return status 404 error (Not found). But in case of IE11 version 11.0.7, it often returns status 0 error and shows Network Error 0x2ee4 inside F12 console, "
I posted the same issue to Microsoft Connect here: https://connect.microsoft.com/IE/feedback/details/877525/ie11-returns-status-0-during-ajax-post-operation-from-an-iframe-xmlhttprequest-network-error-0x2ee4#tabs
I think this is an IE11 bug, but I am not 100% sure and there is no confirmation yet from the IE team. Please help me to confirm whether this is an IE bug, or if there is any problem in my JavaScript code.
UPDATE:
Microsoft said that they can reproduce the problem and will investigate it.
This error is be cause a ssl certificate is invalid. For solve this error see: [Link]
$.get(window.api + 'Values', null, null).done(function () {//solution for IE shit
$.ajax({
type: 'POST',
url: https://api.yourdomain.com,
data: yourData,
success: function (data) {
//do something
},
});
});
I was having the same issue when trying to do a POST call to our HTTPS WCF service (CORS) and looks like it's because of the SSL Certificate.
I had to recreate mine with the following MakeCert Command line
makecert.exe -r -pe -n "CN=*.YourDomain.com" -eku 1.3.6.1.5.5.7.3.1 -ss my -sr localMachine -sky exchange -sp "Microsoft RSA SChannel Cryptographic Provider" -a sha256 -sy 12 "C:\EncryptionCert.cer"
installed the created Cert into Client and server trusted root cert Auth.
After choosing this cert for my Site binding, I was able to successfully call my HTTPS WCF service in IE 11.
I have the same issue too. at first i use make a get request before post. it solve the issue. but when i deep in, i find it's the in the internet option -》 Advanced options
cancel check for server certificate revocation*
cancel check for publisher certificate revocation*
click ok
restart your browser
i resolved the issue
enter image description here