118
Views
3
Comments
Getting error while adding external JS file into the mobile Application Screen
Question

Hi I am using external JS files into the screen under required JS  for some reasons. When I publish its fine but when I tried to open into real mobile device I am getting following error on application load.

Error detail


Module name "crypto" has not been loaded yet for context: _. Use require([])
http://requirejs.org/docs/errors.html#notloaded



eSpaceVer: Id=197, PubId=0, CompiledWith=11.7.3.5968
RequestUrl: https://envioenment/AIOCRDemo/moduleservices/log?clientTimeInMillis=1586266605151 (Method: POST)
AppDomain: /LM/W3SVC/3/ROOT/AIOCRDemo-243-132307399775849565
FilePath: C:\OutSystems\Sandboxes\HKBTMX000\Platform Server\running\AIOCRDemo\
ClientIp: 1.39.191.167
DeviceUUID: 9f1f9c92bcd578d6
Locale: en-US
DateFormat: yyyy-MM-dd
PID: 4228 ('w3wp', Started='2/12/2020 11:55:34 AM', Priv=678Mb, Virt=2117093Mb)
TID: 30
Thread Name:
.NET: 4.0.30319.42000
DeviceModel: RMX1851
DeviceUUID: 9f1f9c92bcd578d6
OperatingSystem: Android 10
NativeShell: 8.2.4
AppVersionCode: 1
AppVersionName: 0.1
NetworkStatus: Online
NetworkType: LTE
Cordova: 8.1.0
Client-Side Log



Error: Module name "crypto" has not been loaded yet for context: _. Use require([])
http://requirejs.org/docs/errors.html#notloaded
    at makeError (https://dileepverma.outsystemscloud.com/AIOCRDemo/scripts/OutSystems.js?PGHrEBzLHyLxW9cX_pLDCA:1:1016)
    at Object.o [as require] (https://dileepverma.outsystemscloud.com/AIOCRDemo/scripts/OutSystems.js?PGHrEBzLHyLxW9cX_pLDCA:1:10980)
    at requirejs (https://dileepverma.outsystemscloud.com/AIOCRDemo/scripts/OutSystems.js?PGHrEBzLHyLxW9cX_pLDCA:1:14728)
    at https://Environment/AIOCRDemo/scripts/AIOCRDemo.tfjs.js?YxyS+HwGPawe877rcjB7Ow:2:88410
    at https://Environment.outsystemscloud.com/AIOCRDemo/scripts/AIOCRDemo.tfjs.js?YxyS+HwGPawe877rcjB7Ow:2:88440
    at Mn (https://dileepverma.outsystemscloud.com/AIOCRDemo/scripts/AIOCRDemo.tfjs.js?YxyS+HwGPawe877rcjB7Ow:2:81879)
    at https://Environment.outsystemscloud.com/AIOCRDemo/scripts/AIOCRDemo.tfjs.js?YxyS+HwGPawe877rcjB7Ow:2:86934
    at https://Environment.outsystemscloud.com/AIOCRDemo/scripts/AIOCRDemo.tfjs.js?YxyS+HwGPawe877rcjB7Ow:2:140
    at https://Environment.outsystemscloud.com/AIOCRDemo/scripts/AIOCRDemo.tfjs.js?YxyS+HwGPawe877rcjB7O


Please help me


Thanks & Regards,

Dileep Verma

Rank: #2929

Hi Dileep,

Your external js file have dependency which need to be loaded before your function call. Kindly check that all files loaded and function call are in a sequence .

Hope this helps!!!!

Cheers,

Ali Amin

mvp_badge
MVP
Rank: #112

Hi Dileep,

May I know how you are icluding external js file on your screen.

You should use RequireScript client action from system espace on oninitialize or onready event or the screen. This action will resolve your issue because if axecution flow will continue only after script is loaded and it will also handle multiple call for same external script URL. 

You can also check its details on below documentation link

https://success.outsystems.com/Documentation/11/Reference/OutSystems_APIs/System_Actions#RequireScript


Hi Dileep,

Even I am facing the same issue in Reactive App. Did you found any solution for it?

Please help me.


Regards,

Bhagyashree S.