Cannot Instantiate New Instance of A Web Page

I am experiencing a very weird problem
There are certain web pages in my application that i cannot instantiate.
The compiler doesn’t flag any errors.
The program just stuck at the instruction and would never move to the next line.

The line is as below:

Session.thisMainPage = new wpMainPage

Xojo would stuck at that line and wont move to the next instruction.
If i replace any other page, it would work ok.
But i dont see any error and my debugger wont go into the web page

Can anybody point to any kind of mistake?
This actually has happened even in XOJO 2023 R3


Do you have something in the WepPage.Opening event that could be hanging or creating a circular stack? Xojo is supposed to catch StackOverflowException but that would be my first guess.

If you can create a sample project with this problem, you can open an Issue with that for Xojo to review.

I have emptied the weppage.opening event ( and all other events )
Still this happens.

The project was earlier written in R3 and it works in R3.1.
The latest version of R3.1 , when loaded into R4 , wont run and stuck at the said page.

I change this to non-implicit instance and it also gave the same result.
The instruction is stuck there. No error. No flag by the compiler.

Works in R2.
Wont work in R3
Wont work in R4

Make sure you have Implicit Instance unchecked for the page.

i did greg

Just out of curiosity, i compiled it and run it from a real app. After 5 minutes it does move to the next screen. In R2 it does it instantenously

Well if nothing in your code changed from R2 to R3/R4 you could submit a ticket and attach your project privately for Xojo to review. Anything we can offer here without a project to work with is going to be a guess.


You are doing a lot of (possibly unnecessary) work here, and I wonder if one of these lines is causing the issue:

Please try removing the calls to

.visible = true
.visible = true

and see if any of those fix the problem?

For example, in my Web app, the login sequence is much simpler:

WebPage wLoginWindow
sub DoSuccessfulLogin()
    // this function is called when the user has successfully logged in with a valid username/password:  // open the new window
    self.close // close the login screen
end sub

Thanks Tim. I ll prepare this later

I did all that in desperation to see how that can be resolved. Trust me its not that messy previously.

In the end, what i found out:

  1. The same program that run well in 2023 R2 ( from login in landing page to main page instantly )
  2. Will take a few minutes ( in compiled mode ) to move from login in landing page to the main page.
    It will take a lot longer in debug mode and stuck for a few minutes at instancing the main page (wpMainPage).

I ll prepare and submit ticket to issues later as this program is quite large and have a number of resources.

Thank you everyone for your assistance.

New development about this problem.

even instantiating plain dialog box now takes 10 minutes in this module.

Initially i thought it was because my main page has many items.
now instantiating just simple dialog page from the landing page will take 10 minutes.


  1. LandingPage : in login successful show main page. Takes 10 minutes to show.


  1. LandingPage : while processing login ( while waiting for the 10 minutes to complete ),
    tried to show a simple dialog window like this

the code will stuck at instancing the new dialog for about 10 minutes as well.

It doesn’t happen in other pages.
Just in this landing page.

Instead of doing new WebDialog how about just dragging an instance of the custom WebDialog to the WebPage and then just call WebDialog1.Show – it should be functionally equivalent, and if it works it may help you narrow down the bug.

If you can figure out a small test case, please submit a ticket

Thanks Mike.

I resorted to recreating a new landing page altogether.
I suspect it might have something to do with moving this page from the previous version.
So far everything now works acceptable ( still slow, but not as slow as before ).

I will try your proposed solution later.