mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #3356] [Issue]: Server build fails on staging — TS2304 'Cannot find name lorebooksStorage' in characters.routes.ts #1819
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#1819
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kolacheee on GitHub (Jul 8, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3356
Originally assigned to: @SpicyMarinara, @kolacheee on GitHub.
Summary
The server package fails to build on
staging(2.1.1):tscreportsTS2304: Cannot find name 'lorebooksStorage'three times inpackages/server/src/routes/characters.routes.ts(lines 1360, 1393, 1404), sopnpm build/pnpm checkexit with code 2. The app can still be started (the dev runtime transpiles per-file without a full type-check), but every build attempt fails andgit fetch/ re-pnpm installdo not help.Expected behavior
pnpm build(andpnpm check) complete successfully on a freshstagingcheckout.Actual behavior
Steps to reproduce
git checkout staging && git pullpnpm installpnpm build(orpnpm check)→ the server build fails with the three
TS2304errors above. Reproduced by at least two users (Windows 11), and it is not OS-specific — it is a plain type error in the committed source.Environment
913ab5523)Logs, screenshots, or video
See the
TS2304block above.Additional context
Root cause — a semantic merge conflict between two lorebook PRs that git could not detect textually:
const lorebooksStorage = createLorebooksStorage(app.db)and thecreateLorebooksStorageimport fromcharacters.routes.ts. Those existed only to feed the export bundling that PR reverts, and on the branch's own base nothing else used them.POST /:id/embedded-lorebook/embedhandler, which useslorebooksStorage(the three failing lines). It branched off the pre-revert state, where the const/import still existed.7ba6257ce) after #3349 (400dd4aff) without being rebased onto the post-#3349 tree. Because #3343's added usage lines and #3349's removed declaration lines sit in different parts of the file, git auto-merged with no textual conflict, producing a tree that referenceslorebooksStoragebut never declares it. (This exact hazard was called out in #3349's PR description as a rebase interaction to reconcile.)Suggested fix — re-introduce the storage handle the embed endpoint now depends on, in
characters.routes.ts:import { createLorebooksStorage } from "../services/storage/lorebooks.storage.js";charactersRoutes, next to the other storage consts (const storage = …/characterGallery/personaGallery, ~line 544), add:const lorebooksStorage = createLorebooksStorage(app.db);The revert only needed to drop the export-bundling helpers; the storage handle itself is legitimately used by the embed feature and should stay.
Does this corrupt lorebooks? No. This is a compile-time type error, not a data path:
lorebooks.routes.ts, which has its own separatecreateLorebooksStorage(app.db)instance (unaffected).ReferenceErroron the firstlorebooksStoragereference — before any DB write — so even calling it cannot produce a partial or corrupt state.tsc-based build gate fails.Template check