Skip to content

Build broken on main: syntax errors in src/routes/users.ts and src/routes/webhooks.ts #558

Description

@Kingvic300

Summary

main currently fails to compile. Both npx tsc --noEmit and npm run lint error out with parser failures:

src/routes/users.ts(357,1): error TS1005: '}' expected.
src/routes/webhooks.ts(267,1): error TS1005: '}' expected.

Confirmed on a clean checkout of main (no local changes) — unrelated to any in-flight PR.

Likely cause

Looking at src/routes/webhooks.ts, there's a dangling block with no enclosing declaration:

function serializeDelivery(row: WebhookDelivery) {
  return { ... };
}

// ---------------------------------------------------------------------------
// Router
// ---------------------------------------------------------------------------

  // Enforce CORS allowlist before admin auth so unapproved origins are
  // rejected early without leaking auth challenge details.
  router.use(webhookCors());
  router.use(requireAdmin);

  router.get("/", async (req, res, next) => {
    ...

The const webhooksRouter = Router(); declaration (and a matching closing brace/export) appear to be missing — the file reads like two independently-written route modules (admin subscription CRUD vs. CORS-allowlisted delivery listing) that got concatenated rather than merged. This lines up with several recent merges in the history being resolved with git merge -X theirs (see PRs #551#554), which can silently drop non-conflicting hunks from a file when two branches touch it concurrently.

src/routes/users.ts likely has the same root cause and needs the same kind of inspection.

Impact

  • npm run build fails (prebuild → tsc).
  • npm run lint fails.
  • Any PR whose CI compares against a clean main will inherit these failures regardless of what the PR itself touches.

Suggested fix

Someone familiar with the intended behavior of both conflicting features (webhook subscription management vs. CORS allowlist enforcement in webhooks.ts; whatever collided in users.ts) should reconcile the two implementations by hand rather than re-running the automatic merge.

Found while working on #342 (OpenAPI examples for markets) — that PR is intentionally scoped to markets/OpenAPI only and does not attempt to fix this.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions