[GH-ISSUE #725] [Issue]: Noodle 1.2.20: ReferenceError: or is not defined in listPostPage breaks "Load more" pagination #372

Closed
opened 2026-10-20 17:26:57 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @stochasticbrainrot on GitHub (Sep 5, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/725

Originally assigned to: @Gunterlie, @SpicyMarinara on GitHub.

Title: Noodle 1.2.20: ReferenceError: or is not defined in listPostPage breaks "Load more" pagination

Package / version: noodle 1.2.20 (server bundle server.mjs)
Marinara Engine: v2.3.0+ (fresh package install over an existing database)
Platform: macOS

Summary
Clicking "Load more" on the Noodle timeline fails server-side with ReferenceError: or is not defined thrown from Object.listPostPage. The first page loads fine; only cursor-based pagination is broken.

Steps to reproduce
Install Noodle 1.2.20 from Agents → Download Agents and restart when prompted.
Open Home → Noodle and let the first page of the timeline load.
Scroll down and click "Load more".
Observe no new posts; server log shows the error below.

Expected: The next page of posts loads.
Actual: Request fails with a 500-level error and this log entry:

{"level":50,"reqId":"req-25","err":{"type":"ReferenceError","message":"or is not defined","stack":"ReferenceError: or is not defined\n at Object.listPostPage (file:///.../capability-runtime-snapshots/noodle-1.2.20-<snapshot-id>/server.mjs:51:30891)"},"msg":"or is not defined"}

Root cause
In the bundled server.mjs, listPostPage builds its keyset-pagination cursor roughly as:

cursor = cursorAt && cursorId
? or(lt(posts.createdAt, cursorAt), and(eq(posts.createdAt, cursorAt), lt(posts.id, cursorId)))
: null

Every other drizzle-orm helper on that line is minified (and→De, eq→M, inArray→We, lt→Lg, desc→ht), but or( appears with its original name. Drizzle's or does exist in the bundle under the alias an, but nothing binds or in listPostPage's scope. This indicates the source module defining listPostPage never imported or from drizzle-orm, so the bundler treated it as a free global and left it unresolved. The first page never evaluates the or(...) branch (no cursor), which is why only "Load more" fails.

Suggested fix
Add or to the drizzle-orm import in the server module that defines listPostPage, e.g.:

import { and, desc, eq, inArray, lt, or } from "drizzle-orm";

Then rebuild and republish the package. Optionally add a pagination test that exercises the cursor branch, since the first-page path masks this entirely.

Notes
Not database-related: reproduces on a fresh package install over an existing DB, and the failure is a static unresolved identifier, not a data issue.
Snapshot files are read-only and hash-pinned by manifest.json, so end users cannot hot-patch the bundle locally; a package update is required.

Marinara Engine diagnostics
Version: 2.4.5
Build: 2.4.5+f6efd5ee607b
Commit: f6efd5ee607b
Server OS: macOS 26.6.2 (arm64)
Server memory: heap 168.7 / 4288 MiB; RSS 384.9 MiB
Background wake lock: not reported
Last detected freeze: none detected
Previous session: restarted itself for an update or a settings restart at 2026-09-05T17:57:45.865Z
Sessions ended without shutdown: 0 recorded
Client OS: iPadOS (WebKit 605.1.15)
Browser / app shell: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/27.0 Safari/605.1.15
GPU: Apple GPU
Active connection: Fable (Lite)
Connection provider: anthropic
LLM model: claude-fable-5-1

Originally created by @stochasticbrainrot on GitHub (Sep 5, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/725 Originally assigned to: @Gunterlie, @SpicyMarinara on GitHub. **Title:** Noodle 1.2.20: `ReferenceError: or is not defined` in `listPostPage` breaks "Load more" pagination **Package / version:** `noodle` 1.2.20 (server bundle `server.mjs`) **Marinara Engine:** v2.3.0+ (fresh package install over an existing database) **Platform:** macOS **Summary** Clicking "Load more" on the Noodle timeline fails server-side with `ReferenceError: or is not defined` thrown from `Object.listPostPage`. The first page loads fine; only cursor-based pagination is broken. **Steps to reproduce** Install Noodle 1.2.20 from Agents → Download Agents and restart when prompted. Open Home → Noodle and let the first page of the timeline load. Scroll down and click "Load more". Observe no new posts; server log shows the error below. **Expected:** The next page of posts loads. **Actual:** Request fails with a 500-level error and this log entry: ```json {"level":50,"reqId":"req-25","err":{"type":"ReferenceError","message":"or is not defined","stack":"ReferenceError: or is not defined\n at Object.listPostPage (file:///.../capability-runtime-snapshots/noodle-1.2.20-<snapshot-id>/server.mjs:51:30891)"},"msg":"or is not defined"} ``` **Root cause** In the bundled `server.mjs`, `listPostPage` builds its keyset-pagination cursor roughly as: ```js cursor = cursorAt && cursorId ? or(lt(posts.createdAt, cursorAt), and(eq(posts.createdAt, cursorAt), lt(posts.id, cursorId))) : null ``` Every other drizzle-orm helper on that line is minified (`and`→`De`, `eq`→`M`, `inArray`→`We`, `lt`→`Lg`, `desc`→`ht`), but `or(` appears with its original name. Drizzle's `or` *does* exist in the bundle under the alias `an`, but nothing binds `or` in `listPostPage`'s scope. This indicates the source module defining `listPostPage` never imported `or` from `drizzle-orm`, so the bundler treated it as a free global and left it unresolved. The first page never evaluates the `or(...)` branch (no cursor), which is why only "Load more" fails. **Suggested fix** Add `or` to the `drizzle-orm` import in the server module that defines `listPostPage`, e.g.: ```ts import { and, desc, eq, inArray, lt, or } from "drizzle-orm"; ``` Then rebuild and republish the package. Optionally add a pagination test that exercises the cursor branch, since the first-page path masks this entirely. **Notes** Not database-related: reproduces on a fresh package install over an existing DB, and the failure is a static unresolved identifier, not a data issue. Snapshot files are read-only and hash-pinned by `manifest.json`, so end users cannot hot-patch the bundle locally; a package update is required. Marinara Engine diagnostics Version: 2.4.5 Build: 2.4.5+f6efd5ee607b Commit: f6efd5ee607b Server OS: macOS 26.6.2 (arm64) Server memory: heap 168.7 / 4288 MiB; RSS 384.9 MiB Background wake lock: not reported Last detected freeze: none detected Previous session: restarted itself for an update or a settings restart at 2026-09-05T17:57:45.865Z Sessions ended without shutdown: 0 recorded Client OS: iPadOS (WebKit 605.1.15) Browser / app shell: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/27.0 Safari/605.1.15 GPU: Apple GPU Active connection: Fable (Lite) Connection provider: anthropic LLM model: claude-fable-5-1
bsakaguchi 2026-10-20 17:26:57 +07:00
  • closed this issue
  • added the
    bug
    label
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Agents#372
No description provided.