Troubleshooter
Diagnose and fix common issues in Open Mercato standalone apps. Follow the systematic approach: identify symptoms, check common causes, verify fixes.
Table of Contents
- Diagnostic Flow
- Module Issues
- Entity & Migration Issues
- API Route Issues
- UI & Widget Issues
- Build & Type Issues
- Extension Issues
- Database Issues
- Quick Diagnostics
1. Diagnostic Flow
When the developer reports a problem, follow this order:
Step 1: Identify the Layer
| Symptom |
Layer |
Go to |
| Module not discovered / route 404 |
Module wiring |
§2 |
| Database column/table errors |
Entity & Migration |
§3 |
| API returns 500 / wrong data |
API Route |
§4 |
| Page blank / component missing |
UI & Widget |
§5 |
| Build fails / type errors |
Build & Type |
§6 |
| Enricher/interceptor/widget not working |
Extension |
§7 |
| Connection refused / query errors |
Database |
§8 |
Step 2: Check Generated Files
Run these commands first — they fix 60%+ of issues:
yarn generate # Regenerate module discovery files
yarn dev # Restart dev server
If the issue persists after yarn generate, continue to the specific section.
Step 3: Verify the Basics
# Check module is registered
grep '<module_id>' src/modules.ts
# Check generated files exist
ls .mercato/generated/
# Check for TypeScript errors
yarn typecheck
2. Module Issues
Module not found / not loading
Symptoms: 404 on module routes, module not in sidebar, "module not registered" errors
Checklist:
Is the module registered in src/modules.ts?
// Must have this entry:
{ id: '<module_id>', from: '@app' }
Fix: Add the entry and run yarn generate.
Did you run yarn generate?
Check if .mercato/generated/ contains your module's entries.
Fix: Run yarn generate.
Is the module folder named correctly?
Must be plural, snake_case: src/modules/<module_id>/
Fix: Rename folder to match module ID.
Does index.ts export metadata?
export const metadata: ModuleInfo = { name: '<module_id>', ... }
Fix: Add the metadata export.
Is the dev server running with latest changes?
Fix: Restart with yarn dev.
Module loads but pages 404
Symptoms: Module appears in generated files but backend pages return 404
Checklist:
Are backend page files in the right location?
- List page:
backend/page.tsx (not backend/index.tsx)
- Detail page:
backend/<entities>/[id].tsx (bracket notation)
Fix: Rename to match auto-discovery convention.
Do pages export metadata with requireAuth?
export const metadata = { requireAuth: true, features: ['<module_id>.view'] }
Fix: Add metadata export.
Does the user have the required ACL features?
Check setup.ts has defaultRoleFeatures for the user's role.
Fix: Add features to role defaults, re-run setup.
3. Entity & Migration Issues
"Column does not exist" / "Table does not exist"
Symptoms: Database queries fail with missing column/table errors
Checklist:
Did you create a migration after adding/changing the entity?
yarn db:generate # Creates migration file
Fix: Run yarn db:generate to create the migration.
Did you apply the migration?
yarn db:migrate # Applies pending migrations
Fix: Run yarn db:migrate.
Is the migration file correct?
Check src/modules/<module_id>/migrations/ for the latest migration.
Verify it has the expected columns and types.
Fix: If wrong, delete the migration file, fix the entity, and regenerate.
Migration generation creates unexpected changes
Symptoms: yarn db:generate produces migrations for unrelated modules
Checklist:
Are node_modules up to date?
yarn install
Did you modify a core module entity without ejecting?
Never edit node_modules/@open-mercato/*.
Fix: Revert changes to node_modules. Use UMES extensions instead, or eject the module.
Entity changes not reflected
Symptoms: Changed entity file but API still returns old schema
Checklist:
- Run
yarn generate — entity discovery is cached
- Run
yarn db:generate — schema needs a migration
- Run
yarn db:migrate — migration needs to be applied
- Restart
yarn dev — server caches entity metadata
4. API Route Issues
Route returns 404
Checklist:
Is the file in the correct path?
src/modules/<module_id>/api/<method>/<route-path>.ts
Method folders: get/, post/, put/, delete/
Does it export a default handler?
export default handler
Does it export openApi?
export const openApi = { summary: '...', tags: ['...'] }
API routes without openApi export are not discovered.
Did you run yarn generate?
Route returns 500
Checklist:
- Check server logs — look for the actual error message
- Is the entity imported correctly? Verify import path
- Is
organization_id filtering applied? Required for all tenant-scoped queries
- Is the zod schema matching the request body? Schema validation errors return 422, not 500
Route returns 401 / 403
Checklist:
- Is the user authenticated? Check session/token
- Does the user have required features? Check
acl.ts + setup.ts role mapping
- Are features assigned to the user's role? Check role configuration in admin
5. UI & Widget Issues
Backend page is blank
Checklist:
- Does the page have
'use client' directive? Required for pages with interactivity
- Check browser console for errors — React rendering errors appear there
- Is the correct import path used? Use
@open-mercato/ui/backend/...
- Are API calls using
apiCall / apiCallOrThrow? Never use raw fetch
DataTable shows no data or missing rows
Checklist:
- Is the API path correct? Check
apiPath prop matches actual API route
- Is the entity ID correct? Check
entityId prop
- Does the API return data? Test with
curl or browser devtools
- Does the user have
view feature? Check ACL
- Are pagination props wired? Without
page, pageSize, totalCount, and onPageChange, the table only shows the first page with no pagination controls. Check the API returns totalCount in the response.
- Is
organization_id scoping correct? Records created without proper organization_id won't appear when the API filters by current org
- Are records soft-deleted? Records with
deletedAt set are filtered out by default
Sidebar icons broken or wrong
Checklist:
- Are icons using
lucide-react components? Import from lucide-react (e.g., import { Trophy } from 'lucide-react')
- AVOID
React.createElement('svg', ...) — inline SVG via React.createElement is fragile in bundler contexts and can produce broken icons after yarn generate
- Is the icon defined in
page.meta.ts? Export as part of metadata.icon
- Did you run
yarn generate? The generator reads icon metadata from page.meta.ts
Correct pattern:
// page.meta.ts
import { Trophy } from 'lucide-react'
export const metadata = { icon: <Trophy className="size-4" /> }
CrudForm doesn't save
Checklist:
- Check browser network tab — look for the POST/PUT request and response
- Is the zod schema matching the form fields? Mismatched field names cause silent failures
- Are required fields filled? Check form validation
- Does the API route handle the HTTP method? Check
api/post/ or api/put/ exists
6. Build & Type Issues
yarn build fails
Checklist:
- Run
yarn typecheck first — isolates type errors from build errors
- Run
yarn generate first — regenerates type-dependent files
- Check import paths — use
@open-mercato/<package>/... for framework imports
- Check for circular imports — module A importing from module B importing from module A
Type errors after adding a module
Checklist:
- Run
yarn generate — updates generated type files
- Check entity imports — use correct relative or package paths
- Check zod schema matches entity — types derived from zod must align
"Module not found" in imports
Checklist:
- Is the package installed? Check
package.json dependencies
- Is the import path correct? Framework packages use
@open-mercato/<package>/...
- Is the package built? Run
yarn install to link workspace packages
7. Extension Issues
Response Enricher data not appearing
Checklist:
Is data/enrichers.ts exporting enrichers array?
export const enrichers = [enricher]
Did you run yarn generate? Enrichers are auto-discovered
Is targetEntity correct? Must match the target module's entity ID exactly
(e.g., customers.person not customers.people)
Is the enricher throwing silently? Check critical: false (default) — errors are swallowed.
Temporarily set critical: true to surface errors.
Check enricher id is unique — duplicate IDs cause only one to run
Widget not appearing in target module
Checklist:
Is the widget mapped in injection-table.ts?
export const widgetInjections = {
'<spot-id>': { widgetId: '<your-widget-id>', priority: 50 },
}
Is the spot ID correct? Check the exact format:
- Forms:
crud-form:<entityId>:fields
- Tables:
data-table:<tableId>:columns
- Menus:
menu:sidebar:main
Does the widget file export default?
export default widget
Is the widget metadata.id unique? Duplicate IDs cause conflicts
Did you run yarn generate? Widgets are auto-discovered
API Interceptor not running
Checklist:
Is api/interceptors.ts exporting interceptors array?
export { interceptors }
Does targetRoute match? Check exact route path (without /api/ prefix)
Does methods include the HTTP method? e.g., ['GET', 'POST']
Is the interceptor throwing instead of returning { ok: false }?
Errors in interceptors are caught silently
Check priority — lower priority runs first. Another interceptor may be blocking
Component replacement not working
Checklist:
- Is
widgets/components.ts exporting componentOverrides?
- Is the
componentId handle correct? Use ComponentReplacementHandles helpers
- For
replacement mode: is propsSchema provided?
- Did you run
yarn generate?
8. Database Issues
Connection refused
Checklist:
Is PostgreSQL running?
docker compose ps # Check container status
docker compose up -d # Start if stopped
Is .env configured correctly? Check DATABASE_URL
Is the database created?
yarn initialize # Creates DB + first admin
Query timeout / slow queries
Checklist:
- Are indexes present on
organization_id and tenant_id? Check entity has @Index()
- Is the query filtering by
organization_id? Missing filter = full table scan
- Are enrichers using batch queries? Missing
enrichMany causes N+1
9. Quick Diagnostics
The "Fix Everything" Sequence
When nothing else works, run this full reset sequence:
yarn generate # 1. Regenerate all discovery files
yarn typecheck # 2. Check for type errors
yarn db:generate # 3. Check for pending migrations
yarn db:migrate # 4. Apply any pending migrations
yarn dev # 5. Restart dev server
Common Error → Fix Table
| Error Message |
Likely Cause |
Fix |
Module '<id>' not found |
Not in src/modules.ts |
Add entry, yarn generate |
Table '<name>' does not exist |
Missing migration |
yarn db:generate + yarn db:migrate |
Column '<name>' does not exist |
Entity changed without migration |
yarn db:generate + yarn db:migrate |
Cannot find module '@open-mercato/...' |
Package not installed |
yarn install |
Route not found / 404 |
Missing openApi export or wrong path |
Add export, yarn generate |
401 Unauthorized |
Missing auth or session expired |
Check login, check requireAuth |
403 Forbidden |
User lacks required feature |
Check acl.ts + setup.ts roles |
422 Unprocessable Entity |
Zod validation failed |
Check request body matches schema |
| Widget not showing |
Missing injection-table.ts mapping |
Add mapping, yarn generate |
| Enricher data missing |
critical: false hiding errors |
Set critical: true temporarily |
| Interceptor not running |
Wrong targetRoute or methods |
Check exact route path and methods |
ECONNREFUSED |
Database/service not running |
docker compose up -d |
| DataTable shows fewer rows than expected |
Missing pagination props or API totalCount |
Wire page/pageSize/totalCount/onPageChange props |
| Sidebar icons broken or wrong |
Inline SVG via React.createElement |
Use lucide-react components in page.meta.ts |
yarn generate changes unexpected files |
Stale generated files |
Delete .mercato/generated/, re-run |
Rules
- ALWAYS run
yarn generate as first diagnostic step
- ALWAYS check server logs / browser console for actual error messages
- NEVER edit files in
.mercato/generated/ or node_modules/
- NEVER assume the issue — verify with actual error output
- Fix the root cause, not the symptom — temporary workarounds become permanent bugs
- When suggesting a fix, include the exact command or code change needed
1---2name: troubleshooter-23description: Diagnose and fix common issues in Open Mercato standalone apps. Use when encountering errors, unexpected behavior, modules not loading, widgets not appearing, migrations failing, build errors, or any "it doesn't work" situation. Triggers on "error", "not working", "broken", "fix", "debug", "why isn't", "can't", "fails", "crash", "missing", "404", "500", "module not found", "widget not showing".4---56# Troubleshooter78Diagnose and fix common issues in Open Mercato standalone apps. Follow the systematic approach: identify symptoms, check common causes, verify fixes.910## Table of Contents11121. [Diagnostic Flow](#1-diagnostic-flow)132. [Module Issues](#2-module-issues)143. [Entity & Migration Issues](#3-entity--migration-issues)154. [API Route Issues](#4-api-route-issues)165. [UI & Widget Issues](#5-ui--widget-issues)176. [Build & Type Issues](#6-build--type-issues)187. [Extension Issues](#7-extension-issues)198. [Database Issues](#8-database-issues)209. [Quick Diagnostics](#9-quick-diagnostics)2122---2324## 1. Diagnostic Flow2526When the developer reports a problem, follow this order:2728### Step 1: Identify the Layer2930| Symptom | Layer | Go to |31|---------|-------|-------|32| Module not discovered / route 404 | Module wiring | §2 |33| Database column/table errors | Entity & Migration | §3 |34| API returns 500 / wrong data | API Route | §4 |35| Page blank / component missing | UI & Widget | §5 |36| Build fails / type errors | Build & Type | §6 |37| Enricher/interceptor/widget not working | Extension | §7 |38| Connection refused / query errors | Database | §8 |3940### Step 2: Check Generated Files4142Run these commands first — they fix 60%+ of issues:4344```bash45yarn generate # Regenerate module discovery files46yarn dev # Restart dev server47```4849If the issue persists after `yarn generate`, continue to the specific section.5051### Step 3: Verify the Basics5253```bash54# Check module is registered55grep '<module_id>' src/modules.ts5657# Check generated files exist58ls .mercato/generated/5960# Check for TypeScript errors61yarn typecheck62```6364---6566## 2. Module Issues6768### Module not found / not loading6970**Symptoms**: 404 on module routes, module not in sidebar, "module not registered" errors7172**Checklist**:73741. **Is the module registered in `src/modules.ts`?**75 ```typescript76 // Must have this entry:77 { id: '<module_id>', from: '@app' }78 ```79 Fix: Add the entry and run `yarn generate`.80812. **Did you run `yarn generate`?**82 Check if `.mercato/generated/` contains your module's entries.83 Fix: Run `yarn generate`.84853. **Is the module folder named correctly?**86 Must be plural, snake_case: `src/modules/<module_id>/`87 Fix: Rename folder to match module ID.88894. **Does `index.ts` export `metadata`?**90 ```typescript91 export const metadata: ModuleInfo = { name: '<module_id>', ... }92 ```93 Fix: Add the metadata export.94955. **Is the dev server running with latest changes?**96 Fix: Restart with `yarn dev`.9798### Module loads but pages 40499100**Symptoms**: Module appears in generated files but backend pages return 404101102**Checklist**:1031041. **Are backend page files in the right location?**105 - List page: `backend/page.tsx` (not `backend/index.tsx`)106 - Detail page: `backend/<entities>/[id].tsx` (bracket notation)107 Fix: Rename to match auto-discovery convention.1081092. **Do pages export `metadata` with `requireAuth`?**110 ```typescript111 export const metadata = { requireAuth: true, features: ['<module_id>.view'] }112 ```113 Fix: Add metadata export.1141153. **Does the user have the required ACL features?**116 Check `setup.ts` has `defaultRoleFeatures` for the user's role.117 Fix: Add features to role defaults, re-run setup.118119---120121## 3. Entity & Migration Issues122123### "Column does not exist" / "Table does not exist"124125**Symptoms**: Database queries fail with missing column/table errors126127**Checklist**:1281291. **Did you create a migration after adding/changing the entity?**130 ```bash131 yarn db:generate # Creates migration file132 ```133 Fix: Run `yarn db:generate` to create the migration.1341352. **Did you apply the migration?**136 ```bash137 yarn db:migrate # Applies pending migrations138 ```139 Fix: Run `yarn db:migrate`.1401413. **Is the migration file correct?**142 Check `src/modules/<module_id>/migrations/` for the latest migration.143 Verify it has the expected columns and types.144 Fix: If wrong, delete the migration file, fix the entity, and regenerate.145146### Migration generation creates unexpected changes147148**Symptoms**: `yarn db:generate` produces migrations for unrelated modules149150**Checklist**:1511521. **Are node_modules up to date?**153 ```bash154 yarn install155 ```1561572. **Did you modify a core module entity without ejecting?**158 Never edit `node_modules/@open-mercato/*`.159 Fix: Revert changes to node_modules. Use UMES extensions instead, or eject the module.160161### Entity changes not reflected162163**Symptoms**: Changed entity file but API still returns old schema164165**Checklist**:1661671. Run `yarn generate` — entity discovery is cached1682. Run `yarn db:generate` — schema needs a migration1693. Run `yarn db:migrate` — migration needs to be applied1704. Restart `yarn dev` — server caches entity metadata171172---173174## 4. API Route Issues175176### Route returns 404177178**Checklist**:1791801. **Is the file in the correct path?**181 `src/modules/<module_id>/api/<method>/<route-path>.ts`182 Method folders: `get/`, `post/`, `put/`, `delete/`1831842. **Does it export a default handler?**185 ```typescript186 export default handler187 ```1881893. **Does it export `openApi`?**190 ```typescript191 export const openApi = { summary: '...', tags: ['...'] }192 ```193 API routes without `openApi` export are not discovered.1941954. **Did you run `yarn generate`?**196197### Route returns 500198199**Checklist**:2002011. **Check server logs** — look for the actual error message2022. **Is the entity imported correctly?** Verify import path2033. **Is `organization_id` filtering applied?** Required for all tenant-scoped queries2044. **Is the zod schema matching the request body?** Schema validation errors return 422, not 500205206### Route returns 401 / 403207208**Checklist**:2092101. **Is the user authenticated?** Check session/token2112. **Does the user have required features?** Check `acl.ts` + `setup.ts` role mapping2123. **Are features assigned to the user's role?** Check role configuration in admin213214---215216## 5. UI & Widget Issues217218### Backend page is blank219220**Checklist**:2212221. **Does the page have `'use client'` directive?** Required for pages with interactivity2232. **Check browser console for errors** — React rendering errors appear there2243. **Is the correct import path used?** Use `@open-mercato/ui/backend/...`2254. **Are API calls using `apiCall` / `apiCallOrThrow`?** Never use raw `fetch`226227### DataTable shows no data or missing rows228229**Checklist**:2302311. **Is the API path correct?** Check `apiPath` prop matches actual API route2322. **Is the entity ID correct?** Check `entityId` prop2333. **Does the API return data?** Test with `curl` or browser devtools2344. **Does the user have `view` feature?** Check ACL2355. **Are pagination props wired?** Without `page`, `pageSize`, `totalCount`, and `onPageChange`, the table only shows the first page with no pagination controls. Check the API returns `totalCount` in the response.2366. **Is `organization_id` scoping correct?** Records created without proper `organization_id` won't appear when the API filters by current org2377. **Are records soft-deleted?** Records with `deletedAt` set are filtered out by default238239### Sidebar icons broken or wrong240241**Checklist**:2422431. **Are icons using `lucide-react` components?** Import from `lucide-react` (e.g., `import { Trophy } from 'lucide-react'`)2442. **AVOID `React.createElement('svg', ...)`** — inline SVG via `React.createElement` is fragile in bundler contexts and can produce broken icons after `yarn generate`2453. **Is the icon defined in `page.meta.ts`?** Export as part of `metadata.icon`2464. **Did you run `yarn generate`?** The generator reads icon metadata from `page.meta.ts`247248**Correct pattern**:249```tsx250// page.meta.ts251import { Trophy } from 'lucide-react'252export const metadata = { icon: <Trophy className="size-4" /> }253```254255### CrudForm doesn't save256257**Checklist**:2582591. **Check browser network tab** — look for the POST/PUT request and response2602. **Is the zod schema matching the form fields?** Mismatched field names cause silent failures2613. **Are required fields filled?** Check form validation2624. **Does the API route handle the HTTP method?** Check `api/post/` or `api/put/` exists263264---265266## 6. Build & Type Issues267268### `yarn build` fails269270**Checklist**:2712721. **Run `yarn typecheck` first** — isolates type errors from build errors2732. **Run `yarn generate` first** — regenerates type-dependent files2743. **Check import paths** — use `@open-mercato/<package>/...` for framework imports2754. **Check for circular imports** — module A importing from module B importing from module A276277### Type errors after adding a module278279**Checklist**:2802811. **Run `yarn generate`** — updates generated type files2822. **Check entity imports** — use correct relative or package paths2833. **Check zod schema matches entity** — types derived from zod must align284285### "Module not found" in imports286287**Checklist**:2882891. **Is the package installed?** Check `package.json` dependencies2902. **Is the import path correct?** Framework packages use `@open-mercato/<package>/...`2913. **Is the package built?** Run `yarn install` to link workspace packages292293---294295## 7. Extension Issues296297### Response Enricher data not appearing298299**Checklist**:3003011. **Is `data/enrichers.ts` exporting `enrichers` array?**302 ```typescript303 export const enrichers = [enricher]304 ```3053062. **Did you run `yarn generate`?** Enrichers are auto-discovered3073083. **Is `targetEntity` correct?** Must match the target module's entity ID exactly309 (e.g., `customers.person` not `customers.people`)3103114. **Is the enricher throwing silently?** Check `critical: false` (default) — errors are swallowed.312 Temporarily set `critical: true` to surface errors.3133145. **Check enricher `id` is unique** — duplicate IDs cause only one to run315316### Widget not appearing in target module317318**Checklist**:3193201. **Is the widget mapped in `injection-table.ts`?**321 ```typescript322 export const widgetInjections = {323 '<spot-id>': { widgetId: '<your-widget-id>', priority: 50 },324 }325 ```3263272. **Is the spot ID correct?** Check the exact format:328 - Forms: `crud-form:<entityId>:fields`329 - Tables: `data-table:<tableId>:columns`330 - Menus: `menu:sidebar:main`3313323. **Does the widget file export default?**333 ```typescript334 export default widget335 ```3363374. **Is the widget `metadata.id` unique?** Duplicate IDs cause conflicts3383395. **Did you run `yarn generate`?** Widgets are auto-discovered340341### API Interceptor not running342343**Checklist**:3443451. **Is `api/interceptors.ts` exporting `interceptors` array?**346 ```typescript347 export { interceptors }348 ```3493502. **Does `targetRoute` match?** Check exact route path (without `/api/` prefix)3513523. **Does `methods` include the HTTP method?** e.g., `['GET', 'POST']`3533544. **Is the interceptor throwing instead of returning `{ ok: false }`?**355 Errors in interceptors are caught silently3563575. **Check `priority`** — lower priority runs first. Another interceptor may be blocking358359### Component replacement not working360361**Checklist**:3623631. **Is `widgets/components.ts` exporting `componentOverrides`?**3642. **Is the `componentId` handle correct?** Use `ComponentReplacementHandles` helpers3653. **For `replacement` mode**: is `propsSchema` provided?3664. **Did you run `yarn generate`?**367368---369370## 8. Database Issues371372### Connection refused373374**Checklist**:3753761. **Is PostgreSQL running?**377 ```bash378 docker compose ps # Check container status379 docker compose up -d # Start if stopped380 ```3813822. **Is `.env` configured correctly?** Check `DATABASE_URL`3833843. **Is the database created?**385 ```bash386 yarn initialize # Creates DB + first admin387 ```388389### Query timeout / slow queries390391**Checklist**:3923931. **Are indexes present on `organization_id` and `tenant_id`?** Check entity has `@Index()`3942. **Is the query filtering by `organization_id`?** Missing filter = full table scan3953. **Are enrichers using batch queries?** Missing `enrichMany` causes N+1396397---398399## 9. Quick Diagnostics400401### The "Fix Everything" Sequence402403When nothing else works, run this full reset sequence:404405```bash406yarn generate # 1. Regenerate all discovery files407yarn typecheck # 2. Check for type errors408yarn db:generate # 3. Check for pending migrations409yarn db:migrate # 4. Apply any pending migrations410yarn dev # 5. Restart dev server411```412413### Common Error → Fix Table414415| Error Message | Likely Cause | Fix |416|--------------|-------------|-----|417| `Module '<id>' not found` | Not in `src/modules.ts` | Add entry, `yarn generate` |418| `Table '<name>' does not exist` | Missing migration | `yarn db:generate` + `yarn db:migrate` |419| `Column '<name>' does not exist` | Entity changed without migration | `yarn db:generate` + `yarn db:migrate` |420| `Cannot find module '@open-mercato/...'` | Package not installed | `yarn install` |421| `Route not found` / 404 | Missing `openApi` export or wrong path | Add export, `yarn generate` |422| `401 Unauthorized` | Missing auth or session expired | Check login, check `requireAuth` |423| `403 Forbidden` | User lacks required feature | Check `acl.ts` + `setup.ts` roles |424| `422 Unprocessable Entity` | Zod validation failed | Check request body matches schema |425| Widget not showing | Missing `injection-table.ts` mapping | Add mapping, `yarn generate` |426| Enricher data missing | `critical: false` hiding errors | Set `critical: true` temporarily |427| Interceptor not running | Wrong `targetRoute` or `methods` | Check exact route path and methods |428| `ECONNREFUSED` | Database/service not running | `docker compose up -d` |429| DataTable shows fewer rows than expected | Missing pagination props or API `totalCount` | Wire `page`/`pageSize`/`totalCount`/`onPageChange` props |430| Sidebar icons broken or wrong | Inline SVG via `React.createElement` | Use `lucide-react` components in `page.meta.ts` |431| `yarn generate` changes unexpected files | Stale generated files | Delete `.mercato/generated/`, re-run |432433---434435## Rules436437- **ALWAYS** run `yarn generate` as first diagnostic step438- **ALWAYS** check server logs / browser console for actual error messages439- **NEVER** edit files in `.mercato/generated/` or `node_modules/`440- **NEVER** assume the issue — verify with actual error output441- Fix the root cause, not the symptom — temporary workarounds become permanent bugs442- When suggesting a fix, include the exact command or code change needed