Error in module that doesn't exist

Getting this error :

ImportError: No module named sub_test_form_1

No reference to that module exists. It might have at some point, but it definitely doesn’t now.
ctl-alt-F search doesn’t find it.

https://anvil.works/build#clone:I7CIUOZBXXCQJEON=7XXBW74WIPVFRVH7VGTSLXLL
(you might have to dump the dependency to run it)

Fixing it

The Startup Form is still set to sub_test_form_1. (If you Git clone the app and look at the anvil.yaml you’ll see that it has startup: {type: form, module: sub_test_form_1}).

You can fix it by setting client_list to be the Startup Form.


Reproducing it

I can’t seem to get an app into this state. I’ve tried two things:

  • Create an app
  • Delete the Startup Form
  • Add a new Form

And

  • Create an App
  • Add a new Form
  • Delete the Startup Form

In both cases, you end up with just Form2, and that is marked as the Startup Form.

I don’t expect you do, but… do you remember what sequence of creating and deleting Forms you carried out?

1 Like

Roughly …
duplicated sub_test_form_1
renamed duplicate to sub_test_form_1_old
set sub_test_form_1 to component
deleted sub_test_form_1_old
renamed sub_test_form_1 to client_list

Plus various code changes.
That’s as good as I can remember I’m afraid. Takes a while before it registers that it’s not you doing something wrong and you start to take note of your attempts to fix it.#

1 Like

It doesn’t accept my anvil password? Erm…?

edit 2FA won’t let me. i think it might be easier just to recreate the project …

edit 2 actually generating the key was easier than I expected. Got it now.

edit3 - that worked, thanks!

1 Like