Repository navigation
fix(server): ship zod in the desktop app for @cursor/sdk 1.0.38 - #6
Closed
SebastianBachAndersen wants to merge 1 commit into
Closed
SebastianBachAndersen wants to merge 1 commit into
SebastianBachAndersen wants to merge 1 commit into
Conversation
@cursor/sdk 1.0.38 moved zod from dependencies to peerDependencies. The desktop build only stages runtime externals that apps/server declares, so zod was no longer packaged and the backend exited on start with "Cannot find module 'zod/v4'", leaving no window. Declare zod directly, pinned to the version the lockfile already resolves for the SDK. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
|
Closing: upstream fixed this in pingdotgg/t3code 7c3b3b3 (pingdotgg#25841), which also adds a regression test. We'll get it by pulling upstream. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What went wrong
After updating to
0.1.4~spy.1the desktop app started, but no window ever appeared. The backend child process exited on every start, and the desktop shell retried it every 10 seconds:(from
~/.t3/userdata/logs/server-child.log)Cause
@cursor/sdkfrom 1.0.35 to 1.0.38.zodis a normal dependency of the SDK. In 1.0.38 it is only a peer dependency (^3.25.0 || ^4.0.0).scripts/lib/cli-external-packages.tskeepszodout of the server bundle (it is inCURSOR_RUNTIME_DEPENDENCIES). The desktop build then stages only the runtime externals thatapps/server/package.jsondeclares (selectCliRuntimeExternalDependencies). Before, the SDK pulledzodin as its own dependency. Now nothing declares it, soapp.asarcontains nozodat all.Fix
Declare
zodas a direct dependency ofapps/server, pinned to4.6.5, the version the lockfile already resolves for@cursor/sdk@1.0.38. The lockfile change only adds that importer entry.Verification
0.1.4~spy.1: puttingzod@4.6.5into/opt/T3 Code (SPY)/resources/node_modules/zodmade the backend start and the window appear.app.asarcontainsnode_modules/zod(e.g.npx @electron/asar list app.asar | grep /zod/package.json).Users on
0.1.4~spy.1need a0.1.4~spy.2(or later) built from this. Upstream has the same SDK bump and probably the same bug.🤖 Generated with Claude Code