Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v3] App panics when opening and closing windows repeatedly #4131

Open
mbaklor opened this issue Mar 12, 2025 · 0 comments
Open

[v3] App panics when opening and closing windows repeatedly #4131

mbaklor opened this issue Mar 12, 2025 · 0 comments
Labels
Bug Something isn't working

Comments

@mbaklor
Copy link

mbaklor commented Mar 12, 2025

Description

When opening and closing windows on windows 11, at around the 10th window opened, the app freezes and crashes with a panic. On times when it doesn't panic sometimes the windows both turn white or freeze in an unresponsive view for a bit before the new window opens.

The panic message is

Mar  9 16:33:42.161 INF Asset Request: windowName="" windowID=12 code=200 method=GET path=/settings/ duration=1.4969ms
2025/03/09 16:33:43 1: github.com/wailsapp/go-webview2/pkg/edge.(*Chromium).errorCallback
        C:/Users/Michael-PC/go/pkg/mod/github.com/wailsapp/[email protected]/pkg/edge/chromium.go:151
[WebView2 Error] The group or resource is not in the correct state to perform the requested operation.
2025/03/09 16:33:43 2: github.com/wailsapp/go-webview2/pkg/edge.(*Chromium).Focus
        C:/Users/Michael-PC/go/pkg/mod/github.com/wailsapp/[email protected]/pkg/edge/chromium.go:580

2025/03/09 16:33:43 3: github.com/wailsapp/wails/v3/pkg/application.(*windowsWebviewWindow).focus
        C:/Users/Michael-PC/development/wails/v3/pkg/application/webview_window_windows.go:782
Stack trace:
2025/03/09 16:33:43 4: github.com/wailsapp/wails/v3/pkg/application.(*windowsWebviewWindow).WndProc
        C:/Users/Michael-PC/development/wails/v3/pkg/application/webview_window_windows.go:1144
2025/03/09 16:33:43 5: github.com/wailsapp/wails/v3/pkg/application.(*windowsApp).wndProc
        C:/Users/Michael-PC/development/wails/v3/pkg/application/application_windows.go:256
2025/03/09 16:33:43 6: runtime.callbackWrap
        C:/Program Files/Go/src/runtime/syscall_windows.go:396
2025/03/09 16:33:43 7: runtime.cgocallbackg1
        C:/Program Files/Go/src/runtime/cgocall.go:444
2025/03/09 16:33:43 8: runtime.cgocallbackg
        C:/Program Files/Go/src/runtime/cgocall.go:350
2025/03/09 16:33:43 9: runtime.cgocallback
        C:/Program Files/Go/src/runtime/asm_amd64.s:1084
2025/03/09 16:33:43 10: runtime.systemstack_switch
        C:/Program Files/Go/src/runtime/asm_amd64.s:479
2025/03/09 16:33:43 11: runtime.cgocall
        C:/Program Files/Go/src/runtime/cgocall.go:185
2025/03/09 16:33:43 12: runtime.syscall_syscalln
        C:/Program Files/Go/src/runtime/syscall_windows.go:521
2025/03/09 16:33:43 13: syscall.SyscallN
        C:/Program Files/Go/src/runtime/syscall_windows.go:500
2025/03/09 16:33:43 14: syscall.(*Proc).Call
        C:/Program Files/Go/src/syscall/dll_windows.go:167
2025/03/09 16:33:43 15: syscall.(*LazyProc).Call
        C:/Program Files/Go/src/syscall/dll_windows.go:287
2025/03/09 16:33:43 16: github.com/wailsapp/wails/v3/pkg/w32.DispatchMessage
        C:/Users/Michael-PC/development/wails/v3/pkg/w32/user32.go:463
2025/03/09 16:33:43 17: github.com/wailsapp/wails/v3/pkg/application.(*windowsApp).runMainLoop
        C:/Users/Michael-PC/development/wails/v3/pkg/application/mainthread_windows.go:64
2025/03/09 16:33:43 18: github.com/wailsapp/wails/v3/pkg/application.(*windowsApp).run
        C:/Users/Michael-PC/development/wails/v3/pkg/application/application_windows.go:154
2025/03/09 16:33:43 19: github.com/wailsapp/wails/v3/pkg/application.(*App).Run
        C:/Users/Michael-PC/development/wails/v3/pkg/application/application.go:686
2025/03/09 16:33:43 20: main.main
        C:/Users/Michael-PC/development/wails-route-test/main.go:87
2025/03/09 16:33:43 21: runtime.main
        C:/Program Files/Go/src/runtime/proc.go:283
[0309/163343.556:ERROR:window_impl.cc(122)] Failed to unregister class Chrome_WidgetWin_0. Error = 1412
  ERROR   task: Failed to run task "run": exit status 1

To Reproduce

clone my example project, open and close the "settings" window a few times (usually around 10), happens both in dev mode and in production builds

Expected behaviour

the windows should not freeze when opening a new window and the app shouldn't crash when opening windows multiple times

Screenshots

wails-window-test.mp4

Attempted Fixes

No response

System Details

Wails (v3.0.0-dev)  Wails Doctor

# System

┌────────────────────────────────────────────────────────────────────────────────────────────┐
| Name              | Windows 10 Pro                                                         |
| Version           | 2009 (Build: 26100)                                                    |
| ID                | 24H2                                                                   |
| Branding          | Windows 11 Pro                                                         |
| Platform          | windows                                                                |
| Architecture      | amd64                                                                  |
| Go WebView2Loader | true                                                                   |
| WebView2 Version  | 133.0.3065.92                                                          |
| CPU               | 12th Gen Intel(R) Core(TM) i7-12700                                    |
| GPU 1             | Intel(R) UHD Graphics 770 (Intel Corporation) - Driver: 32.0.101.6078  |
| Memory            | 16GB                                                                   |
└────────────────────────────────────────────────────────────────────────────────────────────┘

# Build Environment

┌─────────────────────────────────────────────────────────┐
| Wails CLI    | v3.0.0-dev                               |
| Go Version   | go1.24.0                                 |
| Revision     | 28d22f7bfa4e752e68cc340a2f802dc16beb7b17 |
| Modified     | false                                    |
| -buildmode   | exe                                      |
| -compiler    | gc                                       |
| CGO_CFLAGS   |                                          |
| CGO_CPPFLAGS |                                          |
| CGO_CXXFLAGS |                                          |
| CGO_ENABLED  | 1                                        |
| CGO_LDFLAGS  |                                          |
| GOAMD64      | v1                                       |
| GOARCH       | amd64                                    |
| GOOS         | windows                                  |
| vcs          | git                                      |
| vcs.modified | false                                    |
| vcs.revision | 28d22f7bfa4e752e68cc340a2f802dc16beb7b17 |
| vcs.time     | 2025-02-27T10:02:02Z                     |
└─────────────────────────────────────────────────────────┘

# Dependencies

┌───────────────────────────┐
| npm  | 10.9.2             |
| NSIS | v3.11              |
|                           |
└─ * - Optional Dependency ─┘

# Checking for issues

 SUCCESS  No issues found

# Diagnosis

 SUCCESS  Your system is ready for Wails development!

Additional context

this happens both on windows 10 and 11, I'm not sure if it's windows exclusive but this feels like a webview issue so I'll assume it is

@mbaklor mbaklor added the Bug Something isn't working label Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant