Skip to content

[Bug]: Packaged desktop backend fails to start with Cannot find module 'zod/v4' after @cursor/sdk 1.0.38 #25840

Closed

Description

@jason5545

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

Build, CI, or release tooling

Steps to reproduce

  1. Build the desktop app from main at or after 850d1e7 (fix(provider-cursor): bump @cursor/sdk to 1.0.38 so long-context tiers send Max Mode #21074, @cursor/sdk 1.0.35 → 1.0.38), e.g. d033768ec7.
  2. Launch the packaged app.

Expected behavior

The bundled backend starts.

Actual behavior

The backend child exits immediately with Cannot find module 'zod/v4', required from app.asar/node_modules/@cursor/sdk/dist/cjs/index.js. The desktop app retries and then gives up, so there is no server.

@cursor/sdk 1.0.38 moved zod from dependencies to peerDependencies ("zod": "^3.25.0 || ^4.0.0"). zod is a runtime external of the server bundle (CURSOR_RUNTIME_DEPENDENCIES in scripts/lib/cli-external-packages.ts), but the desktop stage only receives the externals that apps/server/package.json lists (selectCliRuntimeExternalDependencies(serverDependencies)), and apps/server does not list zod. Before 1.0.38, zod reached the stage as a regular dependency of @cursor/sdk; now nothing staged depends on it, and app.asar ships @cursor/sdk without it.

No release is affected yet: v0.1.3 and the latest nightly (d2c440312e5f) predate #21074. The next nightly built from main will be the first to carry it.

Impact

Blocks work completely

Version or commit

main @ d033768

Environment

macOS 26 (Apple Silicon), desktop nightly. Observed on a fork build that merged upstream main at 6bbb2d8508; the fork's changes to scripts/build-desktop-artifact.ts are limited to dev signing and a locale, and the dependency staging is identical to upstream. Linux and Windows builds were not checked, nor was the npx t3 CLI archive, which uses the same external selection but no electron-builder.

Logs or stack traces

Error: Cannot find module 'zod/v4'
Require stack:
- /Applications/T3 Code (Nightly).app/Contents/Resources/app.asar/node_modules/@cursor/sdk/dist/cjs/index.js
- /Applications/T3 Code (Nightly).app/Contents/Resources/app.asar/apps/server/dist/binCli-tX336eyv.mjs
    at Module._resolveFilename (node:internal/modules/cjs/loader:1571:15)
    ...
    at zod/v4 (/Applications/T3 Code (Nightly).app/Contents/Resources/app.asar/node_modules/@cursor/sdk/dist/cjs/index.js:1:267549)
  code: 'MODULE_NOT_FOUND'

Node.js v24.22.0

Workaround

Add "zod": "^4.6.5" to apps/server/package.json dependencies (the version already in the lockfile). With that, app.asar contains node_modules/zod beside @cursor/sdk and the backend starts. A PR with this change and a regression test follows.

Activity

  1. jarrednorrisdev commented on Oct 27, 2026

    @jarrednorrisdev

    Confirmed on the official nightly 0.1.4-nightly.20261027.3766 (e109dc8), macOS 27.0 (Apple Silicon), desktop app with its built-in backend. The app auto-updated from 0.1.3-nightly.20261027.3754, which worked. After the update the window never appears: the backend child crashes on every retry (~10s apart) with the same error:

    Error: Cannot find module 'zod/v4'
    Require stack:
    - /Applications/T3 Code (Nightly).app/Contents/Resources/app.asar/node_modules/@cursor/sdk/dist/cjs/index.js
    - /Applications/T3 Code (Nightly).app/Contents/Resources/app.asar/apps/server/dist/binCli-BH8BLs_H.mjs
    Node.js v24.22.0
    

    I checked the shipped app.asar: it has no node_modules/zod at all, and @cursor/sdk has no nested copy. #25841 should fix it. Until a fixed nightly ships, reinstalling 0.1.3-nightly.20261027.3754 works around it.

    Found via t3 triage by Claude Opus 5.5 (claude-opus-5-5) in Claude Code.

  2. Wulfgardr commented on Oct 27, 2026

    @Wulfgardr

    Independently reproduced on the installed macOS ARM64 Nightly 0.1.4-nightly.20261027.3766, commit e109dc8d8941, on macOS 27.2 (26B118).

    The main window never appears. Local server-child.log records MODULE_NOT_FOUND: Cannot find module 'zod/v4', required by app.asar/node_modules/@cursor/sdk/dist/cjs/index.js, then apps/server/dist/binCli-BH8BLs_H.mjs (Node.js v24.22.0). The backend exits with code 1 and retries approximately every 10 seconds.

    Read-only inspection of the installed app.asar confirms that @cursor/sdk is version 1.0.38 and node_modules/zod is absent. This corroborates the report above on another macOS version.

  3. t3dotgg commented on Oct 27, 2026

    @t3dotgg
    Member

    on it

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