Skip to content

Windows: app stays launchable during the multi-minute NSIS update extraction, crashes with ERR_MODULE_NOT_FOUND (false-positive #4154) #5520

Description

@ElliotDrel

On Windows the updater's NSIS installer can take many minutes to unpack resources\app.asar.unpacked\node_modules. On this machine it ran 09:09:07 -> ~09:20 (~11 minutes) for 14,667 files. Throughout that window the app has already quit for the update, no progress UI is shown, and T3 Code (Nightly).exe plus the taskbar/Start Menu shortcuts remain launchable.

Launching mid-extraction produces an uncaught main-process exception:

A JavaScript error occurred in the main process

Uncaught Exception:
Error [ERR_MODULE_NOT_FOUND]: Cannot find module
'C:\Users\<redacted>\AppData\Local\Programs\t3code\resources\app.asar\node_modu...\Context'
imported from
C:\Users\<redacted>\AppData\Local\Programs\t3code\resources\app.asar\no...\NodeHttpClient.js
    at finalizeResolution (node:internal/modules/esm/resolve:275:11)
    at moduleResolve (node:internal/modules/esm/resolve:873:10)
    at defaultResolve (node:internal/modules/esm/resolve:1000:11)

app.asar is already in place from the prior version, so the exe starts, but the unpacked modules it imports have not been written yet. Once the installer finishes it relaunches the app itself with --updated and everything works normally.

Why this is worth guarding

This is byte-identical to the signature in #4154, which is a genuine packaging regression where effect is actually missing from the asar. Users who hit the race will file duplicates of it. The two are easy to tell apart after the fact, but not at the moment the dialog appears:

I verified the former on this machine. After the install completed, effect\dist\Context.js, effect\package.json, @effect\platform-node, undici, and mime were all present, and the app launched fine.

Steps to reproduce

  1. On Windows, be on a machine where extraction is slow (spinning disk, throttled CPU, or heavy concurrent load).
  2. Trigger an update from within the app so it quits and hands off to the NSIS installer.
  3. While the T3-Code-<version>-x64 installer process is still running, click the T3 Code taskbar or Start Menu shortcut.
  4. Observe the uncaught exception dialog.

Whether an install is still in flight is visible as a running process named T3-Code-<version>-x64 (distinct from T3 Code (Nightly)).

Expected behavior

Launching during an update either does nothing, or shows something like "Update in progress, please wait" rather than a raw stack trace.

Suggested fixes

Roughly in order of cheapness:

  1. Have the installer remove or retarget the shortcuts while extraction is in progress and restore them at the end.
  2. Write a sentinel file at the start of extraction and delete it at the end; the main process checks for it on startup and shows a friendly "update in progress" message instead of throwing.
  3. Show installer progress at all, so the multi-minute silent window is at least visible.

Any one of these also cuts down the false-positive duplicates of #4154.

Environment

  • OS: Windows 11 Pro (win32 10.0.26200), x64
  • App: T3 Code (Nightly) 0.0.32-nightly.20260806.1015
  • Install path: %LocalAppData%\Programs\t3code
  • Updater path: %LocalAppData%\t3code-updater\pending\
  • Extraction measured at roughly 96 files/sec for 14,667 files

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions