Feb 18, 2022

Hi Patrick,

If added this line to Client_onStart:

require([“docs/mylib.esm.js”], function(mylib){});

When I launch the client I get error “require is not defined”.

After adding requirejs as custom asset I get 401 Unauthorized for request https://dev.vantiq.com/docs/mylib.esm.js

I added getDocumentUrl to get the URL with access_token:

require([client.getDocumentUrl(“docs/mylib.esm.js”)], function(mylib){});

Then I get a SyntaxError with Message “import declarations may only appear at top level of a module”. This is because the script gets inserted with type=”text/javascript” but needs to be inserted with type=”module”.

I ques this library just isn’t meant to be used with the Client Builder. No worries, if spend enough time on it now and am going to leave it at that. Thanks for your help.

Kind Regards,


© Vantiq 2024 All rights reserved  •  Vantiq Corporation’s Privacy Policy and Cookie Policy