Skip to content

[v3] events.Common.ApplicationStarted no longer fires since alpha.93 #5474

@Mihara

Description

@Mihara

Description

events.Common.ApplicationStarted appears to never fire since alpha 93.

To Reproduce

Consider this minimal replication code:

package main

import (
	_ "embed"
	"log"

	"github.com/wailsapp/wails/v3/pkg/application"
	"github.com/wailsapp/wails/v3/pkg/events"
)

var app *application.App

func main() {
	app = application.New(application.Options{
		Name: "Event Test",
	})

	app.Event.OnApplicationEvent(events.Common.ApplicationStarted,
		func(event *application.ApplicationEvent) {
			app.Window.NewWithOptions(application.WebviewWindowOptions{
				Title: "Main Window",
				URL:   "https://wails.io",
			})
		})

	err := app.Run()
	if err != nil {
		log.Fatal(err)
	}

}

Prior to alpha 93, the window would be created after the application started. In alpha 93 it simply does not appear.

Expected behaviour

I expect events.Common.ApplicationStarted to actually run once the application completes startup. If I should not have this expectation, the API change should have been documented.

Screenshots

No response

Attempted Fixes

No response

System Details

Wails (v3.0.0-alpha.93)  Wails Doctor

# System

┌───────────────────────────────────────────────────────────────────────────────────────────────────────┐
| Name                | Ubuntu                                                                          |
| Version             | 24.04                                                                           |
| ID                  | ubuntu                                                                          |
| Branding            | 24.04.4 LTS (Noble Numbat)                                                      |
| Platform            | linux                                                                           |
| Architecture        | amd64                                                                           |
| Desktop Environment | ubuntu:GNOME                                                                    |
| NVIDIA Driver       | 595.71.05 (58D233B8E3F4A2973D73151)                                             |
| XDG_SESSION_TYPE    | wayland                                                                         |
| CPU                 | AMD Ryzen 9 7940HS w/ Radeon 780M Graphics                                      |
| GPU 1               | AD106M [GeForce RTX 4070 Max-Q / Mobile] (NVIDIA Corporation) - Driver: nvidia  |
| GPU 2               | Phoenix1 (Advanced Micro Devices, Inc. [AMD/ATI]) - Driver: amdgpu              |
| Memory              | 31GB                                                                            |
└───────────────────────────────────────────────────────────────────────────────────────────────────────┘

# Build Environment

┌──────────────────────────────────────────────────────────────────────┐
| Wails CLI      | v3.0.0-alpha.93                                     |
| Go Version     | go1.26.3                                            |
| -buildmode     | exe                                                 |
| -compiler      | gc                                                  |
| CGO_CFLAGS     |                                                     |
| CGO_CPPFLAGS   |                                                     |
| CGO_CXXFLAGS   |                                                     |
| CGO_ENABLED    | 1                                                   |
| CGO_LDFLAGS    |                                                     |
| DefaultGODEBUG | cryptocustomrand=1,tlssecpmlkem=0,urlstrictcolons=0 |
| GOAMD64        | v1                                                  |
| GOARCH         | amd64                                               |
| GOOS           | linux                                               |
└──────────────────────────────────────────────────────────────────────┘

# Dependencies

┌───────────────────────────────────────────────────────────────────────┐
| webkit2gtk (legacy) | 2.52.3-0ubuntu0.24.04.1                         |
| webkitgtk-6.0       | 2.52.3-0ubuntu0.24.04.1                         |
| gcc                 | 12.10ubuntu1                                    |
| gtk3 (legacy)       | 3.24.41-4ubuntu1.3                              |
| gtk4                | 4.14.5+ds-0ubuntu0.10                           |
| npm                 | 10.9.7                                          |
| pkg-config          | 1.8.1-2build1                                   |
| docker              | *podman version 4.9.3 (cross-compilation ready) |
|                                                                       |
└─────────────────────── * - Optional Dependency ───────────────────────┘

# Checking for issues

 SUCCESS  No issues found

# Diagnosis

 SUCCESS  Your system is ready for Wails development!

Additional context

Switching back to alpha 92 fixes the issue. If I had to guess, #4424 is responsible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions