Skip to content

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

@Tanmayshi

Description

@Tanmayshi

❗ 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 where the problem was first reported. Maintainers clarified that this is not a bug but an intentional change β€” hence this formal feature request.

Metadata

Metadata

Assignees

No one assigned

    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