Breakpoints get incorrectly hit on page refresh

10 views
Skip to first unread message

Craig Mitchell

unread,
3:03 AM (5 hours ago) 3:03 AM
to GWT Users
When debugging in Chrome, sometimes my breakpoints get hit on a page refresh, but the code is not executed (nor should it be).

I reproduced the issue with the following:

mvn archetype:generate -DarchetypeGroupId=com.github.nalukit.archetype -DarchetypeVersion=LATEST -DarchetypeArtifactId=modular-springboot-webapp

(use any values, I just entered "a" for everything)

2. Modify the a-client\src\main\java\a\App.java with the following:

2.1 Add this static method:
public static void delay(int delayMs, com.google.gwt.user.client.Command run) {
com.google.gwt.core.client.Scheduler.get().scheduleFixedDelay(() -> {
run.execute();
return false;
}, delayMs);
}

2.2 In the MyHandler class onClick, call the static method:
public void onClick(ClickEvent event) {
delay(1000, () -> {
sendNameToServer();
});
}

3. Start it up:
3.1:  mvn gwt:codeserver -pl *-client -am
3.2:  mvn spring-boot:run -pl *-server -am

4. Open it in Chrome:  http://localhost:8080/

5. Open the Chrome debugger, put a breakpoint on the line:
delay(1000, () -> {

6. Refresh the page.  The breakpoint gets hit.  It looks like this:
Screenshot 2025-12-17 185721.png

It doesn't have a call stack, and if you try to step into it, it doesn't step into the delay method.

Any idea why this occurs?

Craig Mitchell

unread,
3:07 AM (5 hours ago) 3:07 AM
to GWT Users
I also just noticed, the breakpoint doesn't get hit when you click the "send" button on the page (when it should get hit).
Reply all
Reply to author
Forward
0 new messages