I’m trying to run an Anvil app locally using the self-hosted anvil-app-server in Docker (required due to M1 MacBook compatibility). The app uses the Material 3 theme as a dependency and works fine when running on anvil.works (and custom domain), but fails when running locally.
My environment:
OS: macOS (Darwin 23.2.0) - Apple M1
Runtime: Docker container
Python: 3.9
anvil-app-server: 1.14.0 (latest via pip)
anvil-uplink: 0.5.2
What I’ve tried and what’s not working:
When I start the app locally with Docker, it fails to load with the following error:
AttributeError: module 'property_utils' has no attribute 'get_unset_margin'
Traceback:
material_3_theme/client_code/_utils/properties.py:6
material_3_theme/client_code/_Components/Button/__init__.py:6
material_3_theme/client_code/InitModule.py:3
The Material 3 theme imports from anvil.property_utils, but this module doesn’t appear to exist in the local anvil-app-server package. I’ve confirmed I have the latest version of anvil-app-server (1.14.0).
Is Material 3 theme supported for self-hosted apps, or is anvil.property_utils a cloud-only runtime feature?
Code Sample:
# From material_3_theme/client_code/_utils/properties.py
from anvil.property_utils import (
get_margin_styles,
get_padding_styles,
get_spacing_styles,
get_unset_margin,
get_unset_padding,
get_unset_spacing,
get_unset_value,
set_element_margin,
set_element_padding,
set_element_spacing,
)
I thought it had to do with the versions of my dependencies, but even after updating all of them to the latest version, I still get the same error.
Okay so I was able to use anvil-app-server 1.13.4 and indeed that error went away. But now I get (from the router module actually):
AttributeError: '_AppInfo' object has no attribute 'get_client_config'
I am using 1.13.4 because I have a Mac M1, and the newer app-server versions are failing.
Docker’s AMD64 images running through Rosetta emulation on Apple Silicon break with newer Java features required by anvil-app-server 1.14.0+ and 1.15.0, so I am limited to version 1.13.4 which uses older, emulation-compatible Java code.