Alert import in module now throwing error or bug?

I have some code :

# In a Client Module
from anvil import alert

that has been working fine but has now started throwing the following error.

ErrorLoadingUserCode: Error loading user code: Error loading user code: Error loading user code: cannot import name 'alert' from 'anvil' (/downlink/anvil/__init__.py)
at /downlink/anvil_downlink_worker/__init__.py, line 72
  called from <frozen importlib._bootstrap>, line 638
  called from <frozen importlib._bootstrap>, line 668
  called from <frozen importlib._bootstrap>, line 967
  called from <frozen importlib._bootstrap>, line 983
  called from EOMModule, line 13
  called from /downlink/anvil_downlink_worker/__init__.py, line 70
  called from /downlink/anvil_downlink_worker/__init__.py, line 181
  called from Global, line 65
  called from Global, line 65
  called from Supplier.SupplierMain, line 58
  called from Supplier.SupplierMain, line 57
  called from RouteSelector, line 43
  called from RouteSelector, line 47

Even the Error statement seems bug-y and has repeated statements at the start. Same result on Beta and classic IDEs. (Session ID 5e3a6ddd and app ID:3ER2GOXRFYR4CFXE)
Trying other apps this seems to work fine. Is this a bug with this particular app?

The same app is throwing a No function named foo has been registered. This is not true since control clicking on the server function name takes me straight to it (correctly decorated with @anvil.server.callable)

Has anyone else noticed odd behaviour tonight?

UPDATE: Looks like I may have found this error - an import statement importing a client module into a server module seems to be the cause - doesn’t explain the random error code but makes the code run again.

3 Likes