Hi guys,
I have a quick question. I know the issue but I am not able to figure out what to do differently to fix it.
I am using an external library and the library code is inserted in the head.
When the page loads first time, the library does not load. When I refresh it or come back to the page after navigating to a different page. It starts working.
So this is a problem of order of loading. How can I either perform a refresh of the page so the library loads (which is a hacky way and probably not preferable)?
Otherwise what should I do to ensure that the library loads.
Once I refresh the page. It all works fine.
I am sure there is some order of loading issue, not weweb per se. But I was hoping you can shed some light to make it work.
If you want to implement the integration this way you need to set the global variables before you load the library.
My understanding is that the html component will load remote scripts first and then execute inline scripts (at least in the editor), so this implementation is not well suited for use in weweb.
Go deeper in the docs, there are other ways to implement the widget.
I integrated it successfully in a custom component, to have a better developer experience.
I have take a look, it seems that there is no Vue3 wrapper for this library, but using a custom component to be sure that the different scripts are load is correct order seems the good approach (they have a npm package it seems with a js api)