14
Views
8
Comments
Custom JavaScript not working across all environments for some reason.
Service Studio Version
11.10.8 (Build 37957)

Hi All,


I am currently having a slightly odd issue across environments so for background we have 4 environments Dev, Test, Train and Production. 

So we have an application which has an image that we draw points on (like a custom graph) we draw the points on this image using JavaScript. The weird thing is that this works perfectly fine in our Development Environment but doesn't on any of the other environments. 

I have done some investigation and the JavaScript is all the same, it also runs on the environments and isn't erroring but for some reason it does not draw the points like it does on the Dev Environment. Just wanted to know if anyone had faced anything like this before and what they did to fix it. 


Many Thanks 

Daniel Sunner

Rank: #541

Hi Daniel,

Have you tried to see if the browser's console shows something?

Rank: #21030

Hi Kadu,


Yes I have checked the console to check for any errors or warnings but it is exactly the same on all environments with no errors. 


Many Thanks 

Dan 

Rank: #541

Have you tried the Service Center log?

The JS code is inline or in a JS file?

Rank: #21030

It doesn't come back as an error at all unfortunately so nothing comes up in the log as it seems as though it executes fine it just doesn't come across on the screen. 


And the Javascript is written in a script file on the module and is called by a JS node in an onclick action. This is all done in reactive Web just to give some background so it is nothing to do with refreshing.   

Rank: #541

If possible, could you send here the JS code?

Rank: #21030

The JavaScript is pretty long and ugly haha but sure I can send it across although I don't think the issue is with the JS as it works perfectly in the Dev environment? 

Rank: #541

You mentioned that it runs in all environments, but just does not create the elements. Did you debug the JavaScript in the browser?

I asked about the js file, because it is too difficult to help in the dark. Did you check the js code to see if there is any path or environment variable hard coded? Through the browser's console do you can see the js file and the event that is triggering it?

Hello Daniel Sunner is this javaScript accessing anything from outside (external URLs) of your network? If so this could be causing some blockage.