Loading trouble

I’m using 8th wall with PC. If I open URL from app and go back - half the time broke app (can’t load xr from 8th wall by “external script” settings). How fix it?
sometimes loading, sometimes not
open URL by window.location

Do you get any error message in the console?

image

Can you check Devtools to see if the 8th Wall library files has actually been loaded?

Loaded from cache

Sounds like a racing issue, where you are calling XR8 without guarantees that it has been actually loaded. Sometimes it loads before the call, sometimes after. The cache will not show it. Try to add an onload callback or some other way to make sure the library is loaded before you run it.

that’s not guaranted loading before run app?

Hmm, I think it guarantees to load the third party javascript file before the application files. Perhaps, that library might take time for initialization after load, which Playcanvas might not wait for. Just a guess though :slight_smile:

If reload page - all works fine

I’m looking at getting an 8th Wall account to take a look at some of these issues myself when I can.

I don’t have an immediate answer at the moment.

Bug represented if open only in same tab. If open in new tab - all works.

Does 8th Wall have an initialisation callback to use? Thinking this may be a race condition as mentioned earlier by someone else?

Error in initialize, ONLY after back. Loading by URL never error.

<script>
if (perfomance.navigation.type === 2) location.reload(true);
</script>

in index.html solve for droid