AppOfflineError: App is offline

I’ve been getting a bunch of random “AppOfflineError: App is offline” errors the past couple of days when running my app in the IDE.

It seemed to only happen after I would make code changes and would stop throwing these errors a couple minutes after the change.

Now every time I try to run my app in the IDE, I get this error in various locations in my code.

Has anyone else seen this issue?

I believe that has to do with your internet connection:

Doe this not pop up in the published version?

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.

4 Likes

I spoke too soon.

Now whenever I open the IDE in a new Chrome window I can run the app one time and then afterwards, it throws the App is offline error.

If I log in to an Incognito window, I can seemingly run the app an unlimited amount of times without the error.

Thanks @jlatta23,

It’s likely a browser extension doing something unusual.

If you could disable all your chrome extensions and add them back one by one you might find the culprit. Then we can try to replicate our end.

2 Likes

I believe I have figured out the issue.

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.

The confusing part here was that a CORS problem with a javascript library used by the app was causing the app to raise an AppOfflineError.

Is AppOfflineError the correct exception?

Perhaps ExternalError would be more appropriate?

@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.

(A clone link would be :+1:)

:zombie:

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)

image

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.

2 Likes