Repository navigation
fix(web): the desktop app no longer fails to start with "twMerge is not a function" - #14
Merged
Merged
Conversation
…ot a function" #7 made composerDraftStore import the toast module, which imports lib/utils, which imported DraftId from composerDraftStore. In the desktop build that cycle ran cn() before lib/utils had defined twMerge, so the window showed "T3 Code failed to start. TypeError: … is not a function"; the browser tests failed to load with "Cannot access 'twMerge' before initialization". DraftId moves to its own module; composerDraftStore re-exports it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
The fork's desktop app (0.1.9-grant.3) showed "T3 Code failed to start. TypeError: Wot is not a function" at startup.
WotistwMergeinapps/web/src/lib/utils.ts(from the bundle's source map).Cause: #7 (
7d54248fa0) madecomposerDraftStoreimportcomponents/ui/toast, which importslib/utils, which importedDraftIdfromcomposerDraftStore. In that cyclecn()can run beforelib/utilshas definedtwMerge. Upstream'scomposerDraftStorehas no toast import, so upstream is unaffected. The same cycle is why the web browser tests failed to load ongrant/mainwith "Cannot access 'twMerge' before initialization".Fix:
DraftIdmoves toapps/web/src/draftId.ts;composerDraftStorere-exports it, so its importers are unchanged, andlib/utilsimports the new module.vp test runSidebar.logic.browser, ChatView.logic.browser, ChatView.browser, ChatView.modelPick.browser (apps/web)vp test run src/composerDraftStore.test.ts src/lib/utils.test.tsvp run typecheck(apps/web)vp run check:changedunused patchesfailed on a pnpm peer-dependency warning ininfra/relay(unrelated);test(109 files) hit the 900 s limit🤖 Generated with Claude Code