Skip to content

[Bug] Packaged app crashes on startup when main process loads @opencode-ai/util TypeScript source #159

@Astro-Han

Description

@Astro-Han

What happened?

PawWork v0.2.6 packaged macOS app crashes on startup with a main-process JavaScript error before the normal UI opens:

Uncaught Exception:
Error [ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING]: Stripping types is currently unsupported for files under node_modules, for "file:///Applications/PawWork.app/Contents/Resources/app.asar/node_modules/@opencode-ai/util/src/file-extensions.ts"
    at stripTypeScriptModuleTypes (node:internal/modules/typescript:183:11)
    at ModuleLoader.<anonymous> (node:internal/modules/esm/translators:650:29)
    at #translate (node:internal/modules/esm/loader:473:20)
    at afterLoad (node:internal/modules/esm/loader:529:29)
    at ModuleLoader.loadAndTranslate (node:internal/modules/esm/loader:534:12)
    at #getOrCreateModuleJobAfterResolve (node:internal/modules/esm/loader:577:36)
    at afterResolve (node:internal/modules/esm/loader:625:52)
    at ModuleLoader.getOrCreateModuleJob (node:internal/modules/esm/loader:631:12)
    at ModuleJob.syncLink (node:internal/modules/esm/module_job:160:33)
    at ModuleJob.link (node:internal/modules/esm/module_job:245:17)

Confirmed root cause

The v0.2.6 packaged app.asar/out/main/index.js contains a runtime main-process import of @opencode-ai/util/file-extensions. The packaged node_modules/@opencode-ai/util/package.json exports ./* to ./src/*.ts, so Electron resolves that import to node_modules/@opencode-ai/util/src/file-extensions.ts. Node's TypeScript stripping refuses files under node_modules, which makes the main process crash during startup.

Steps to reproduce

  1. Install or open PawWork v0.2.6 from the packaged macOS app bundle or DMG.
  2. Launch PawWork.
  3. The app shows the main-process JavaScript error above before the normal UI opens.

What did you expect to happen?

The packaged app should start normally. Electron main-process runtime code should not load .ts source files from node_modules.

PawWork version

v0.2.6 packaged macOS app.

OS version

macOS 26.3.1 on the local machine where the error was observed.

Can you reproduce it again?

Yes. Opening the v0.2.6 packaged app reproduces the crash.

Fix status

Fix PR: #160. The PR body includes Closes #159, so merging that PR should close this issue.

Follow-up

The direct startup crash is tracked here. The CI and release guard gap that allowed this packaged-only failure to escape is tracked separately in #162.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High prioritybugSomething isn't workingplatformElectron shell, OS integration, packaging, updater, signing, paths, and permissions

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions