Soryboard / Callbacks black screen on changing scene from inside a network.request

Hi,

I’m having a bit of a problem with changing scenes. I have lots of scenes in my app, and up to now I’ve had no problems changing between them.

However, in one scene, I press a button which makes a network request.

The callback function fires, and then itself fires another function (this is necessary in my app’s flow)
That last function calls storyboard.gotoScene…  however, I get a black screen (scene doesnt load), and a Runtime error:
 

Bad argument #-2 to ‘insert’ (proxy expected got nil)

Can anyone explain what’s happening here? 
the scene itself works fine from elsewhere in the app, and is very basic - just a couple of newtext items. 

Runtime error

        bad argument #-2 to ‘insert’ (Proxy expected, got nil)

stack traceback:

        [C]: ?

        [C]: in function ‘insert’

        ?: in function ‘?’

        ?: in function ‘gotoScene’

        c:\rp\register-form.lua:205: in function ‘handler’

        c:\rp\rpfunctions.lua:132: in function <c:\rp\rpfunctions.lua:116>

Runtime error: bad argument #-2 to ‘insert’ (Proxy expected, got nil)

stack traceback:

        [C]: ?

        [C]: in function ‘insert’

        ?: in function ‘?’

        ?: in function ‘gotoScene’

        c:\rp\register-form.lua:205: in function ‘handler’

        c:\rp\rpfunctions.lua:132: in function <c:\rp\rpfunctions.lua:116>

Can you post the code which you think is throwing the exception? (Be sure to wrap in <> button.)

I would think that, mostly likely, you’re passing an argument which, in this case, is causing an internal problem.

The route to debug is to figure out exactly what is being passed in and how it differs to being called normally? When you call it without calling the network functions first, does it work normally?

Can you post the code which you think is throwing the exception? (Be sure to wrap in <> button.)

I would think that, mostly likely, you’re passing an argument which, in this case, is causing an internal problem.

The route to debug is to figure out exactly what is being passed in and how it differs to being called normally? When you call it without calling the network functions first, does it work normally?