Repository navigation
Fix validation server crash on startup under Express 5 - #139
Merged
Merged
Conversation
Express 5 (path-to-regexp v8) rejects the bare '*' route path, so
app.all('*', ...) threw 'Missing parameter name at index 1: *' at startup.
Use a final app.use() handler for the 404 catch-all instead.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
No unresolved issues were identified.
Review effort: Lite
Findings: None
What changed in this PR
Fixes the Express 5 startup crash caused by the unsupported wildcard catch-all route.
Changes:
- Replaces
app.all('*', ...)with terminalapp.use(...). - Preserves the existing JSON 404 response.
| File | Description |
|---|---|
server/src/index.ts |
Updates catch-all handling for Express 5 compatibility. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
sheldonmartin
approved these changes
Oct 8, 2026
sheldonmartin
left a comment
There was a problem hiding this comment.
LGTM! Tested locally and confirmed it works.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
npm run start:servercrashed on startup withPathError [TypeError]: Missing parameter name at index 1: *. Express 5 (path-to-regexp v8) no longer accepts a bare'*'route path, so theapp.all('*', ...)catch-all inserver/src/index.tsthrew when the app registered its routes.This PR replaces it with a final
app.use((_, res) => ...)handler that returns the same 404 response. No other changes.Testing
npm run start:serverbuilds and printsValidation app listening on port 3000.POST /api/v2/segment-target/<integrationKey>is routed correctly. With a real key (amplitude) it returns 200. With the README's placeholder key it returns the route's own 404 (integration with key ... not found).GET /nope,POST /api/v2/other/x,GET /) return 404{"status":404,"message":"not found"}.prettier --checkpasses.🤖 Generated with Claude Code
Note
Overview
Fixes a startup crash on Express 5 by swapping the invalid
app.all('*', …)catch-all for a terminalapp.usemiddleware that still returns the same 404not foundJSON for unmatched routes.Behavior for known API routes and integration-specific 404s is unchanged; only how unmatched paths are registered is updated for path-to-regexp v8 compatibility.
Reviewed by Cursor Bugbot for commit 6ce5d09. Bugbot is set up for automated code reviews on this repo. Configure here.