expressjs / expressjs/express

Restore Support for app.all('*') Wildcard in Express v5

Open
#6,711 20 comments 8 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
69.5k
Forks
25k
Avg merge
4d 20h
Merged PRs (30d)
9

Description

❗ Description:

In Express v5.1.0, routes using app.all('*') (or similar wildcard syntax) fail with:

Error 👹: throw new TypeError(`Missing parameter name at ${i}: ${DEBUG_URL}`);

This change comes from stricter path-to-regexp parsing rules.
In Express v4, the following code worked fine:

app.all('*', (req, res) => res.send('Not Found'));

But in Express v5, developers are forced to write:

app.all('/*splat', (req, res) => res.send('Not Found'));
// or
app.all('/{*splat}', (req, res) => res.send('Not Found'));

This breaks a very common catch-all route pattern used widely in v4 projects.

🔍 Root Cause

1.Express v5 migrated to a stricter version of path-to-regexp.

2.Unnamed wildcards (*) are no longer allowed.

3.Developers must now explicitly name the wildcard parameter.

✅ Expected Behavior

Express v5 should either:

Gracefully support app.all('*') as a valid catch-all syntax (to maintain backward compatibility).

Or, if strict syntax is required:

Provide a clearer error message explaining the new requirement.

Update docs & migration guide to emphasize the change prominently.

📌 Suggested Fixes

Restore legacy * wildcard syntax support (backward compatibility).

Or provide an explicit alternative (e.g. app.all('/*')) documented as the replacement.

Improve error messaging in path-to-regexp.

🔗 Related Issue

This request builds upon [Issue #6664](https://github.com/expressjs/express/issues/6664) where the problem was first reported. Maintainers clarified that this is not a bug but an intentional change — hence this formal feature request.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.