Skip to content

Fix Typewriter plugin startup crash (NRE on named controls)#270

Merged
niksedk merged 1 commit into
mainfrom
typewriter-multifile-publish
May 17, 2026
Merged

Fix Typewriter plugin startup crash (NRE on named controls)#270
niksedk merged 1 commit into
mainfrom
typewriter-multifile-publish

Conversation

@niksedk
Copy link
Copy Markdown
Member

@niksedk niksedk commented May 17, 2026

Summary

Fixes the v1.0 Typewriter plugin aborting with exit code 134 right after launch.

Root cause

`MainWindow` accessed `InfoLabel` / `EndDelayInput` / `OkButton` as if they were auto-assigned fields. Avalonia 11 does not generate fields for `x:Name` elements out of the box (that requires the `Avalonia.NameGenerator` package), so every access threw `NullReferenceException` right after `AvaloniaXamlLoader.Load(this)` returned. The unhandled exception aborted the process with SIGABRT — what the host saw as `exited with code 134`.

Resolved by looking the controls up via `FindControl` in `InitializeComponent` and caching them as fields. Verified locally by publishing osx-arm64 and launching with a fake request — window stays up cleanly.

Bonus fixes

  • Dropped `PublishSingleFile=true` / `IncludeNativeLibrariesForSelfExtract=true` from `typewriter.yml`. Avalonia's recommended deployment is multi-file self-contained — single-file extraction is a known source of native-load surprises. Zip sizes don't grow much.
  • Bumped `plugin.json` version to `1.0.1` and pointed `se5-plugins.json` at the new `se5-typewriter-v1.0.1` release tag so anyone who installed the broken 1.0 sees Update available.

Test plan

  • CI matrix build passes on all six RIDs.
  • Manually dispatch the workflow with tag `se5-typewriter-v1.0.1` after merge to publish the fixed zips.
  • In SE: Get plugins online... shows Update available (1.0.0 → 1.0.1) — install — run the plugin and verify the window opens.

🤖 Generated with Claude Code

MainWindow accessed InfoLabel/EndDelayInput/OkButton as if they were
auto-assigned fields, but Avalonia 11 does not generate those out of
the box without Avalonia.NameGenerator. Resolve them explicitly via
FindControl in InitializeComponent, killing the
NullReferenceException that aborted the plugin with exit code 134
right after Avalonia framework init.

While here, drop PublishSingleFile/IncludeNativeLibrariesForSelfExtract
from the workflow - Avalonia's recommended setup is multi-file
self-contained publish, and the single-file extraction was a known
source of subtle native-load issues.

Bump plugin version to 1.0.1 and point se5-plugins.json at the new
se5-typewriter-v1.0.1 release tag so SE shows "Update available" for
anyone who installed the broken 1.0.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@niksedk niksedk merged commit 53bd06d into main May 17, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant