JS 502 error on the login page making the page load slow

0
Hi everyone, I m trying to fix an error on an application and I do not know where to locate it or how to fix it through the mendix modeler. I have spent most of my morning trying to locate it but not been able to and would be very grateful if anyone can help me please. [If I can comment the line I think this would help, but I cannot find where to do so] To give you more information : We are no longer using this WebRTC API, hence where can I locate this via the Mendix Modeler or via the Cloud instance. I have updated the constants correctly as well but this error is making the login page load very slowly. Below is the error when I check through the browser [Chrome] --> Developer Tools -->Console https://merckprod.iocom.com/scripts/jquery-2.1.1.min.js Failed to load resource: the server responded with a status of 502 (cannotconnect) https://merck.iocom.com/webclient/visiwebrtc.js Failed to load resource: net::ERRCONNECTIONTIMED_OUT closercarevideoconferencing-test.mendixcloud.com/:160 Uncaught ReferenceError: $ is not defined mxui.js:16 Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/. mxui.js:16 'KeyboardEvent.keyLocation' is deprecated. Please use 'KeyboardEvent.location' instead. In the Resource tab [ Chrome] --> Developer Tools -->Resources below is the section that is in reference to the above error shows below Stylesheets for the application login page: <!-- Custom Stylesheet --> <link rel="stylesheet" href="css/theme.css"> <script src="https://merckprod.iocom.com/scripts/jquery-2.1.1.min.js"></script> <script src="https://merck.iocom.com/webclient/visiwebrtc.js"></script> <script src="https://static.opentok.com/v2/js/opentok.min.js"></script> <script> var sessionStarted = 0; var wrtc_session; I have also attached the screenshots!
asked
3 answers
0

Hi Nimesh,

The screenshots seem to have broken. But based on your error I'm expecting that the problem lies in the fact that jquery could not be loaded. Is your login widget relying on jquery? If so make sure the file is in the widget package and also deployed to the location where the script is looking for it. This would be in the deployment/web/scripts folder. The same applies to your visiwebrtc.js file. This one needs to be deployed to /webclient/visiwebrtc.js for it to be loaded from your login page.

Could you post a the code of your login page, for further help. And mention if it is indeed a login page with widgets or a page based on a login.html, that has been adjusted.

The reason the page is currently slow is because it will take up to 30 seconds to determine if the JS is going to be loaded. And if the JS is loaded synchronously it will halt the rendering of the page.

answered
0

Hi Mitchel, Thank you for your response.

I have a few questions, We run this application on the Mendix Clould. So where do I locate the directories which you have mentioned? deployment/web/scripts and /webclient/visiwebrtc.js please? Is it under Request Handlers?

We no longer use webrtc, but a different tool instead; so I am looking to remove all areas that refers to webrtc.

Thanks Nimesh

answered
0

Nimesh,

All javascript files and styles that you want to load should be contained in the theme folder. So in your case the scripts should be in the folder /scripts/ in the theme folder. All files that are added to the theme folder will automatically be placed in the deployment web folder of your application. So if you wanted to reference them in the index file you can just use something like:

./scripts/yourscript.js

You can load css and styles from external sources by referencing them in the index page or the login page, but they must be accessible to the server. Is https://merckprod.iocom.com/scripts/jquery-2.1.1.min.js a public server hosting the jquery files? If so have you just tried loading it in a browser?

It is probably slow loading because its trying to load the different resources but its unable to find them. Hence why you have a connection time out.

Regards

answered