I’m looking at my Server Module that I have been coding in for 6 months, but now it’s blank. If I Run my app, it works fine, but I can’t access my Server Module code. Any ideas what’s going on?
Often this is as simple as refreshing your webpage (and relogging back in).
I see it also from time to time (sometimes the form widgets don’t show either).
Yikes! First things first: Your code is not lost.. You can pull up old versions from within the Anvil editor. (We also have backups that we can use in an emergency. I am pleased to say this is not an emergency.)
Go to “View History” at the bottom of the App Browser. You’ll see a chronological list of all the times you’ve edited your app. (If you’ve explicitly used the “Save Version” button, you can name some of these versions for future reference; otherwise, you’ll have to work it out from the dates. We recommend using “Save Version” whenever you get to a point you might want to go back to.) Choose a recent version (eg from yesterday), and click “Restore this version”:
(The version you’re currently working on will be kept; you can go back to it later if you like.)
Needless to say, losing the contents of a server module is not something that should be happening in Anvil. I’ve certainly never seen it before. @david.wylie (or anyone), if you see something like this again, can you share with us what you were doing immediately beforehand, so we can reproduce it and get it fixed?
I’ve never actually lost the contents, it just looks like I have. A refresh of the browser tends to bring everything back again. Happens more for form layouts than anything else.
I’ve tried a few times to recall what I did, but I’ve never been sure enough to report it. And as I said, nothing really gets actually lost.
@david.wylie was right. False alarm, I just needed to refresh my browser and my blank Server Module was back in action. I could tell the code was never lost because I could still run my app.
I get this happening fairly regularly too. Frightened the life out of me first time, but a
refresh normally sorts it. Sometimes a logout/login is needed too.
Well this is clearly a bug that we should sort out! I have a suspicion that it’s related to using the “Undo” functionality - could @chris, @david.wylie, @owen.campbell comment on whether you see this when you use Undo?
Not on this occasion, but “undo” does have its own little quirks which I’ve been meaning to document.
It happens not too often, and usually when I need to get something done quickly. So it gets “fixed” by a mildly irritable refresh, losing any traces of the cause.
Will try and pause next time…
I’ve mostly had it happen when opeing a module from the menu (in fact, I can’t recall it happening in any other circumstance).
I can’t recall specifically what I did before I saw that but I opened my Mac quickly to check something for a colleague and saw that. I don’t think I had Anvil open from a previous work session, I think I logged in quickly. But I hadn’t had the chance to use Undo.