I found a fix to this but I’m still not sure what was going on. I cleared all my Chrome browsing data and now it works properly: running in the IDE, going to the private link, etc.
I am using a Javascript module that depends on ThreeJS and had hard-coded the URL of my public Anvil app to pull in some stored asset files. This was throwing a CORS error when running the app in the IDE or the private link to my development branch.
I have been running it this way for over a month without seeing the AppOfflineError issue so I might have hit some sort of limit and the server started blocking me?
Regardless, after setting the URL based on the python call: anvil.server.get_app_origin(), everything works as expected.
@jlatta23 - Thanks for the update - could you be a little more specific about the url you were using and how you were fetching the asset? That way we can reproduce this behaviour.
I had this today in an app using the tracking SaaS Hotjar, which needs a JS script like this in Native Libraries (apologies for the image rather than text lol)
So based on this thread, I removed this from Native libraries and it’s working now. Not a big deal as Hotjar wasn’t really that necessary in this case. Weird though.
I have been trying to make a reproducible case to this App is offline error. However I still could not pinpoint what causes the issue.
I am working on chrome, with couple of extensions, however even if I go to incognito mode, with disabled extensions, the error still occurs.
As for the error I can confirm, that it is due to a “failed to fetch” issue. I am not sure if this is helpful, but here it goes.
Uncaught (in promise) TypeError: Failed to fetch
at service-worker:1:48976
at o (service-worker:1:22421)
at Generator._invoke (service-worker:1:23484)
at Generator.next (service-worker:1:22601)
at c (service-worker:1:46610)
at i (service-worker:1:46793)
Python exception: AppOfflineError: App is offline
Edit: added error source
The error message points here:
case 13:
return t.prev = 13, t.next = 16, fetch(r.request.clone());
Let me know if you need any additional info regarding this.