I am trying to load the external Js file (face-api.js) as a required script of page and getting the below error:
[ErrorScreen] Module name "crypto" has not been loaded yet for context: _. Use require([])https://requirejs.org/docs/errors.html#notloaded
although the same code is working with Plain HTML and Javascript project.
already gone through these links (link1 , link2) to load the js file as well and tried provided solutions but nothing helps.
Could you please share the HTML and JavaScript code, or provide a link to download it? This will allow someone to try it in their environment and offer support.
you can download the HTML JS code from here and OML file here.
Note - To run the HTML/JS code I used the visual studio code and run from the link server.
Thank you for sharing the files. I spent some time making it work and noticed that including `face-api.min.js` in Screens causes conflicts and results in the same errors you reported.
Could you please clarify your use case? Do you want to show the video with detection information, or are you expecting to return something to OutSystem actions?
I managed to make it work by uploading all the files to the resources folder. I made a couple of changes:
Please note that this works in Chrome but not in Safari. I will not call this is a solution but a work around.
I have attached the OML file (here) . Feel free to make any changes.
Hi Mayank, I had the same error as you.
To fix it, you need to remove the reference of 'crypto' on the face api min script. After this, you need to import the resources to your application, change the archives without extension to '.bin' and reffer this on the respective 'manifest.json' and then you may use the api. I created one component that do this. you can check on forge:
https://www.outsystems.com/forge/component-overview/20323/facial-recognition-o11
Note: to use on web applications, ou need to activate the 'graphics accelaration' on the web navigator