Skip to content

Bug: Omi Desktop for Windows crashes on launch after restart attempt with "Cannot find module 'ms'" error #10738

Closed

Description

@hugoaap-code

Summary

After closing Omi to check whether recording would resume, the Windows desktop app showed a startup error instead of reopening normally.

This happened after the earlier blank-screen capture problem reported in #10737.

Related issue

Problem

On launch, Omi shows a JavaScript main-process error and fails with:

Error: Cannot find module 'ms'

This appears during app startup, preventing normal use.

Expected behavior

  • Omi should restart normally after being closed
  • Restarting the app should be a valid recovery step after capture issues
  • The app should not fail on launch because of a missing module dependency

Actual behavior

  • Omi was closed to test whether recording would resume after the blank-screen issue
  • On relaunch, the app showed a JavaScript error in the main process
  • The visible error says Cannot find module 'ms'
  • The stack trace points into the packaged Windows app resources

Redacted stack trace detail

The screenshot shows local Windows installation paths. Redacting the personal username, the relevant path pattern is:

C:\Users\<redacted>\AppData\Local\Programs\omi-windows\resources\app.asar\...

Impact

This turns a recording failure into a full app startup failure.

A user who tries to recover from broken capture by restarting the app can end up unable to reopen Omi at all.

Suggested investigation

  • Check why the packaged Windows app is missing the ms module at runtime
  • Verify whether a partial update, corrupted install, or packaging issue can cause this dependency failure
  • Check whether this can be triggered after restarting from a bad capture state
  • Add a safer recovery path or clearer remediation message if a required module is missing
  • Investigate whether the blank-screen capture issue and this startup crash share the same root cause

Environment

  • Omi Desktop
  • Windows
  • Observed on Monday, July 27, 2026

Activity

  1. moved this from Someday to In progress in omi TODO / bountieson Jul 29, 2026
  2. tianmind-studio commented on Jul 29, 2026

    @tianmind-studio
    Contributor

    I reproduced the startup failure from the packaged Windows artifact: electron-builder pruned ms from the Sentry/debug runtime chain, so app.asar/out/main/index.js failed before startup. #10823 fixes that by declaring ms as a direct runtime dependency and adds a final-artifact probe to both unsigned and signed release paths; the rebuilt ASAR and isolated-profile Windows launch passed, and current CI is green. The fix is still awaiting human release-path review and has not merged yet.

  3. hugoaap-code commented on Jul 29, 2026

    @hugoaap-code
    Author

    Additional context for this existing issue:

    This same Cannot find module 'ms' startup crash also happens after using the in-app updater flow on Windows:

    Settings > About > Restart to install latest update

    Observed behavior:

    • Click Restart to install latest update
    • Omi closes and appears to update/install a new version
    • When opening Omi after the update, Windows shows:
      • A JavaScript error occurred in the main process
      • Error: Cannot find module 'ms'

    So this issue is not limited to restarting after a capture problem. It can also be triggered immediately after the built-in Windows update flow, which suggests the updater may be installing or handing off to a broken packaged build.

  4. kodjima33 commented on Aug 2, 2026

    @kodjima33
    Collaborator

    Root cause isolated to the electron-builder version used for the v1.0.33 build, not to a missing dependency declaration — and the packaging bug is already gone on main.

    Evidence (all on the same source tree / same pnpm install --frozen-lockfile, packing win32 x64 with the repo config):

    1. Shipped artifact is broken. Unpacked Omi-for-Windows-Setup-1.0.33.exe (latest Windows release): resources/app.asar.unpacked/node_modules/debug/src/common.js is present and does createDebug.humanize = require('ms'), but ms does not exist anywhere in the package (neither in app.asar nor app.asar.unpacked). That is exactly the reported Cannot find module 'ms'.
    2. v1.0.33 was built with electron-builder 26.8.1 (pnpm-lock.yaml at the release commit dfae049).
    3. Repacking today's main with electron-builder 26.8.1 reproduces it: app.asar.unpacked/node_modules/ms → ABSENT, debug → present.
    4. Repacking the identical tree with 26.15.3 (what main pins today) ships it: app.asar.unpacked/node_modules/ms → present.

    So the collector in app-builder-lib 26.8.x dropped that transitive dep under node-linker=hoisted; #10875 (merged 2026-07-30, after the v1.0.33 release) pinned electron-builder/app-builder-lib to ~26.15.0 and fixed it.

    Remaining user impact: main is still at version 1.0.33, so the only Windows installer/auto-update available is the broken one. The remedy is cutting a new Windows release from main — no further code change is required for the crash itself. The durable guard is still worth having: the packaged-artifact probe in #10823 would have blocked publishing 1.0.33 (its ms dependency declaration is now belt-and-braces).

  5. tianmind-studio commented on Aug 28, 2026

    @tianmind-studio
    Contributor

    Follow-up: the broken 1.0.33 package has now been superseded by published Windows 1.0.34 and 1.0.35 installers after the electron-builder fix in #10875. #10854 has also merged, adding ms as a direct runtime dependency plus final-ASAR probes in both unsigned and signed packaging paths, so this exact omission now fails CI before release. The code and release-guard work is complete; this can be closed once the reporter confirms startup on 1.0.35.

  6. aryanorastar commented on Sep 20, 2026

    @aryanorastar
    Collaborator

    Closing as already fixed on current main.

    #10875 pinned electron-builder ~26.15.0; current main Windows package.json is 1.0.35. Kodjima isolated 26.8.1 dropping transitive ms; 1.0.33 artifact superseded.

  7. moved this from In progress to In review in omi TODO / bountieson Sep 20, 2026
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

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions