Anvil_extras: Local Storage: Import Error Issue On Mobile Device

Describe the bug
I cannot visit my applications on a mobile device because my system is failing to load the local_storage library.

ExternalError: TypeError: Importing a module script failed.
at app/anvil_extras/storage.py, line 19

Version
Which version of anvil-extras are you using?

v2.5.3

To Reproduce
Steps to reproduce the behaviour (including a clone link when applicable):

Here is a URL to visit on a mobile device:

Here is clone:

Expected behavior
Normally it loads fine. It looks like this is affecting my other application as well. Which are using the development branch of anvil extras.

Additional context
Nothing has changed in relation to importing this module.

I have an iphone 13 and I attempted to visit using safari and chrome.

It works on a previously home-screen installed versions of the application, but as soon as I try to visit the app on the browser it fails and yields this error. It also begins to yeild this error if I uninstall from the home screen and re-install.

Git hub issue here:

Apparently posting about the issue has resolved the issue? Who taught who loki!?!

Anvil extras storage uses a cdn to load the JavaScript wrapper (localForage). Looking at CloudFlare status it does look like there have been some recent incidents.

You can mitigate against this issue by using a different cdn provider for localForage in your native libraries

If localForage already exists in the window namespace then anvil-extras won’t try to load it from CDN.

Jsdeliver is a good alternative.
You could also build it yourself and put the script in your theme assets.

5 Likes