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

Activity

  1. JeremieLeblanc commented on Aug 12, 2026

    @JeremieLeblanc

    Adding a data point: in my case the interrupted extraction wasn't transient — it left a
    permanently truncated install that crash-looped for over two weeks, and the updater could
    never recover on its own.

    Environment: Windows 11 Pro (build 26200), nightly channel.

    Timeline (reconstructed from file timestamps):

    • July 27: Auto-update to 0.0.29-nightly.20260727.918 began extracting into
      %LOCALAPPDATA%\Programs\t3-code-desktop at 8:52:56 AM and stopped ~15 seconds later.
      resources\app.asar.unpacked\node_modules was left with exactly 82 packages, ending
      alphabetically at lodash
      — pure-rand and everything after it missing.
    • Every launch since: main-process dialog
      ERR_MODULE_NOT_FOUND: Cannot find module '...\pure-rand\...\congruential32' imported from ...\fast-check.js (same as OP).
    • Aug 11: The updater downloaded 0.0.34-nightly.20260811.1069 to
      %LOCALAPPDATA%\t3code-updater\pending (sha512 verified correct), but it was never
      applied
      — the main process crashes before the auto-install-on-quit hook can run. So a
      broken install can't self-heal even with a valid update sitting on disk; the only exit
      is a manual reinstall.
    • Fix: manually ran the pending installer from the updater cache.

    Related wrinkle: the install directory was renamed between 0.0.29
    (Programs\t3-code-desktop) and 0.0.34 (Programs\t3code). The installer rewrote the
    Start Menu and Desktop shortcuts but not the pinned taskbar shortcut, which kept
    pointing at the orphaned broken copy — so even after a successful reinstall, launching
    from the taskbar reproduces the crash and looks like the update failed again. The old
    directory (1.3 GB) is also left behind with no uninstall entry.

    Suggestions:

    1. On startup, verify install integrity (e.g. a sentinel file from the end of the archive)
      — if it's missing and a hash-valid installer exists in pending, re-run it instead of
      crash-looping.
    2. On install-dir rename, migrate/remove the old directory and update pinned shortcuts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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