Deploying custom Javascript Worker

Reg Paling reg.paling at lokanet.com
Sat Mar 5 15:48:04 UTC 2022


Hi all,

I got to the bottom of this.

The hanging was because I had typed a $workererror() declaration with 
incorrect syntax so that whenever I got an error it was hanging.  After 
I fixed that, it stopped hanging and I could see my error message: "The 
worker is not running".

The problem came down to a custom module (lokanet_jsonwebtoken) that I 
have added and declared in omnis_modules.js.  In the context of the 
test, this particular module wasn't called, but even so it spoiled the 
JAVASCRIPTWorker when it could not find all of its dependencies.  This 
custom module has a dependency on a package called jwk-to-pem . The 
reason it would only work on my Dev computer was that months ago I must 
have naively run "npm install jwk-to-pem" without realising that I had 
not changed directory - so it kindly created a node-modules directory 
inside my user directory and installed the package and all of its 
dependencies in there!  Running Node inside Omnis, it still found the 
package in my user directory.  That's why it worked on my Dev computer 
but nowhere else.  Traps for young players!

Thanks Paul - you were on the right track.

Kind regards,
Reg


On 4/3/2022 4:41 pm, Reg Paling wrote:
> Hi all,
>
> I have written a custom Node module which I now want to deploy with my 
> runtimes.  I use the Deployment Tool to build my runtime app, and the 
> resulting app works on my development computer.
>
> But when I copy it to another computer, calls to the built-in Omnis 
> modules (such as HASHWorker and a JAVASCRIPTWorker calling omnis_test) 
> work properly, but calls to a JAVASCRIPTWorker calling my custom 
> module hang.
>
> I'm pretty sure I have my omnis_modules set up properly.
>
> One difference is that I have Node installed on my dev Computer, 
> whereas on the deployment computers it's not installed.  I don't want 
> to have to install Node - I want my runtimes to use the Node which 
> Omnis has built-in.
>
> Any ideas?
>
> Thanks,
> Reg
>



More information about the omnisdev-en mailing list