path-to-regexp breaking changes
Updated December 4, 2026
On this page
Latest version 9.0.1, released December 4, 2026. Source repository
Packages on npm run on Node.js. Node.js end of life dates.
- From 8.4.2 to 9.0.0: 12 breaking changes in 1 version.
- From 0.2.0 to 9.0.0: 149 breaking changes in 28 versions.
path-to-regexp 9.0.0 breaking changes
- Removed
Keys
The Keys type is no longer exported. Code that references it must be updated. npmjs.com - Removed
TokenData.constructor
new TokenData() was removed in path-to-regexp 9.0.0 npmjs.com - Behavior changed
A path that already includes a trailing delimiter no longer gets an extra optional delimiter appended when matching. github.com - Behavior changed
compile
Passing an empty string as a param to compile now throws instead of producing output. github.com - Behavior changed
match
When a segment has two or more parameters, the last one now takes the greedy match instead of the first. Code relying on the old split must be updated. github.com - Configuration changed
The package now requires Node.js 22 or newer. github.com - Configuration changed
The package is built as ES modules only. Code that loads it with require() must switch to import. github.com - Signature changed
Group.tokens
Was tokens: Token[]; now tokens: readonly Token[]. npmjs.com - Signature changed
pathToRegexp
Was function pathToRegexp(path: Path | Path[], options?: PathToRegexpOptions & ParseOptions): {regexp: RegExp; keys: Keys;}; now function pathToRegexp(path: Path | Path[], options?: PathToRegexpOptions & ParseOptions): {regexp: RegExp... npmjs.com - Signature changed
TokenData
The TokenData class is no longer exported. Code that imports or uses it must be updated. npmjs.com - Signature changed
TokenData.originalPath
Was readonly originalPath?: string | undefined; now originalPath?: string. npmjs.com - Signature changed
TokenData.tokens
Was readonly tokens: Token[]; now tokens: readonly Token[]. npmjs.com
path-to-regexp 8.4.2 breaking changes
- Behavior changed
A trailing backslash in a path pattern now produces an error. Make sure patterns do not end with a backslash. github.com
path-to-regexp 8.4.0 breaking changes
- Behavior changed
Optional group patterns that expand to 256 or more combinations are now rejected instead of generating a very large regex. Users with such routes must simplify them. github.com
path-to-regexp 8.3.0 breaking changes
- Behavior changed
Escaping text now escapes backslash characters as well. Code that relies on backslashes passing through escaped text unchanged should be checked. github.com - Behavior changed
Error messages were improved, so their text differs from before. Code that matches on the old message text may need updating. github.com - Signature changed
compile
Was function compile<P extends ParamData = ParamData>(path: Path, options?: CompileOptions & ParseOptions): (data?: P) => string; now function compile<P extends ParamData = ParamData>(path: Path, options?: CompileOptions & ParseOptions)... npmjs.com - Signature changed
TokenData.constructor
Was constructor(tokens: Token[]); now constructor(tokens: Token[], originalPath?: string | undefined). npmjs.com
path-to-regexp 8.1.0 breaking changes
- Signature changed
compile
Was function compile<P extends ParamData = ParamData>(path: Path, options?: CompileOptions & ParseOptions): PathFunction<P>; now function compile<P extends ParamData = ParamData>(path: Path, options?: CompileOptions & ParseOptions)... npmjs.com - Signature changed
MatchOptions
Was interface MatchOptions; now interface MatchOptions extends PathToRegexpOptions. npmjs.com
path-to-regexp 8.0.0 breaking changes
- Removed
Only the optional group suffix `?` still works. Use wildcards in place of `+`, and `{*foo}` in place of `*`. github.com - Removed
Parameters can no longer be given custom regular expression overrides. Code using them must be changed. github.com - Removed
The loose mode option is no longer available. Code relying on it must be changed. github.com - Removed
CompileOptions.encodePath
CompileOptions.encodePath was removed in path-to-regexp 8.0.0 npmjs.com - Removed
CompileOptions.loose
CompileOptions.loose was removed in path-to-regexp 8.0.0 npmjs.com - Removed
CompileOptions.sensitive
CompileOptions.sensitive was removed in path-to-regexp 8.0.0 npmjs.com - Removed
CompileOptions.strict
CompileOptions.strict was removed in path-to-regexp 8.0.0 npmjs.com - Removed
CompileOptions.validate
CompileOptions.validate was removed in path-to-regexp 8.0.0 npmjs.com - Removed
Key
Key was removed in path-to-regexp 8.0.0 npmjs.com - Removed
MatchOptions.encodePath
MatchOptions.encodePath was removed in path-to-regexp 8.0.0 npmjs.com
And 15 more in this version. Sign up to see every change
Older versions
23 older versions, each with its first changes. Sign up to see every change
Show 23 older versions
path-to-regexp 7.2.0 breaking changes
- Signature changed
match
Was function match<P extends ParamData>(path: Path, options?: MatchOptions): MatchFunction<P>; now function match<P extends ParamData>(path: Path | Path[], options?: MatchOptions): MatchFunction<P>. npmjs.com - Signature changed
pathToRegexp
Was function pathToRegexp(path: Path, options?: PathToRegexpOptions): RegExp & {keys: Key[];}; now function pathToRegexp(path: Path | Path[], options?: PathToRegexpOptions): RegExp & {keys: Key[];}. npmjs.com
path-to-regexp 7.1.0 breaking changes
- Removed
PathRegExp
PathRegExp was removed in path-to-regexp 7.1.0 npmjs.com - Signature changed
compile
Was function compile<P extends object = object>(path: Path, options?: CompileOptions): PathFunction<P>; now function compile<P extends ParamData = ParamData>(path: Path, options?: CompileOptions): PathFunction<P>. npmjs.com
path-to-regexp 7.0.0 breaking changes
- Removed
Arrays and regular expressions are no longer supported as inputs. Pass string paths instead. github.com - Removed
The package is now shipped only as a single CommonJS export instead of an ESM and CommonJS dual package. github.com
And 34 more in this version.
path-to-regexp 6.3.0 breaking changes
- Behavior changed
Patterns that would previously backtrack excessively are now guarded against backtracking, which may change how some complex patterns match or fail. github.com
path-to-regexp 6.1.0 breaking changes
- Default changed
delimiter
The default delimiter is now /, #, and ?, so parameters no longer match across query or fragment parts. If you match non-path strings such as hostnames, set delimiter: '.' explicitly. github.com
path-to-regexp 6.0.0 breaking changes
- Removed
Key.delimiter
Key.delimiter was removed in path-to-regexp 6.0.0 npmjs.com - Removed
Key.optional
Key.optional was removed in path-to-regexp 6.0.0 npmjs.com
And 5 more in this version.
path-to-regexp 5.0.0 breaking changes
- Removed
normalizePathname
normalizePathname is no longer exported. Users must implement the pathname normalization themselves, following the solution documented in the README. npmjs.com - Renamed
RegexpOptions
The RegexpOptions interface is renamed to TokensToRegexpOptions. Update any type imports or annotations that use the old name. npmjs.com
And 4 more in this version.
path-to-regexp 4.0.5 breaking changes
- Removed
whitelist
The whitelist option is gone. Use decodeURI instead, or handle advanced behavior outside path-to-regexp. github.com - Signature changed
normalizePathname
Was function normalizePathname(pathname: string, whitelist?: string | string[]): string; now function normalizePathname(pathname: string): string. npmjs.com
path-to-regexp 4.0.4 breaking changes
- Signature changed
parse
Was function parse(input: string, options?: ParseOptions): Token[]; now function parse(str: string, options?: ParseOptions): Token[]. npmjs.com
path-to-regexp 4.0.3 breaking changes
- Signature changed
normalizePathname
Was function normalizePathname(pathname: string): string; now function normalizePathname(pathname: string, whitelist?: string | string[]): string. npmjs.com
path-to-regexp 4.0.2 breaking changes
- Signature changed
match
Was function match<P extends object = object>(str: Path, options?: ParseOptions & RegexpToFunctionOptions): MatchFunction<P>; now function match<P extends object = object>(str: Path, options?: ParseOptions & RegexpOptions &... npmjs.com
path-to-regexp 4.0.1 breaking changes
- Removed
tokensToRegExp
tokensToRegExp was removed in path-to-regexp 4.0.1 npmjs.com - Renamed
RegExpOptions
Use RegexpOptions instead. npmjs.com
And 1 more in this version.
path-to-regexp 4.0.0 breaking changes
- Removed
default
default was removed in path-to-regexp 4.0.0 npmjs.com - Removed
MatchFunctionOptions
MatchFunctionOptions was removed in path-to-regexp 4.0.0 npmjs.com
And 11 more in this version.
path-to-regexp 3.3.0 breaking changes
- Behavior changed
The 3.3.0 release adds protection against catastrophic backtracking in patterns. Patterns that previously matched slowly may now be rejected or behave differently. github.com
path-to-regexp 3.1.0 breaking changes
- Signature changed
compile
Was function compile <P extends object = object> (path: string, options?: ParseOptions): PathFunction<P>; now function compile <P extends object = object> (path: string, options?: ParseOptions & TokensToFunctionOptions): PathFunction<P>. npmjs.com - Signature changed
tokensToFunction
Was function tokensToFunction <P extends object = object> (tokens: Token[]): PathFunction<P>; now function tokensToFunction <P extends object = object> (tokens: Token[], options?: TokensToFunctionOptions): PathFunction<P>. npmjs.com
path-to-regexp 3.0.0 breaking changes
- Removed
Key.partial
Key.partial was removed in path-to-regexp 3.0.0 npmjs.com - Removed
ParseOptions.delimiters
ParseOptions.delimiters was removed in path-to-regexp 3.0.0 npmjs.com
And 3 more in this version.
path-to-regexp 2.2.0 breaking changes
- Signature changed
PathFunctionOptions.encode
Was encode?: (value: string) => string; now encode?: (value: string, token: Key) => string. npmjs.com
path-to-regexp 2.0.0 breaking changes
- Removed
Key.asterisk
Key.asterisk was removed in path-to-regexp 2.0.0 npmjs.com - Removed
PathFunctionOptions.pretty
PathFunctionOptions.pretty was removed in path-to-regexp 2.0.0 npmjs.com
And 6 more in this version.
path-to-regexp 1.9.0 breaking changes
- Behavior changed
Routes compiled by the 1.x line now include backtracking protection, which can change how matching behaves on pathological inputs. Review routes if you depend on exact regex output. github.com - Behavior changed
re.exec
The result returned by exec on the compiled route regular expression was altered. Code that reads its match array should be checked. github.com
path-to-regexp 1.8.0 breaking changes
- Signature changed
compile
Was function compile (path: string, options?: ParseOptions): PathFunction; now function compile (path: string, options?: ParseOptions & TokensToFunctionOptions): PathFunction. npmjs.com - Signature changed
tokensToFunction
Was function tokensToFunction (tokens: Token[]): PathFunction; now function tokensToFunction (tokens: Token[], options?: TokensToFunctionOptions): PathFunction. npmjs.com
path-to-regexp 1.6.0 breaking changes
- Removed
Options
Options was removed in path-to-regexp 1.6.0 npmjs.com - Signature changed
compile
Was function compile (path: string): PathFunction; now function compile (path: string, options?: ParseOptions): PathFunction. npmjs.com
And 3 more in this version.
path-to-regexp 0.2.2 breaking changes
- Behavior changed
A trailing slash passed in non-strict mode is now treated as optional in matching. Check route patterns that relied on the slash being required. github.com - Behavior changed
In non-end mode, the optional trailing slash now matches only at the end of the path. Check non-end patterns that depended on matching a slash in the middle. github.com
path-to-regexp 0.2.0 breaking changes
- Removed
The asterisk no longer matches all paths in route patterns. Update any routes that relied on the `*` wildcard to use the new parameter suffixes or another pattern. github.com - Behavior changed
Paths containing regexp special characters are now rejected. Code that passed such characters in path strings must escape or change them. github.com
Check your code
These are the changes. To see which of them reach your code, scan a public repository, or have your coding agent call check_code with your manifest or lockfile over MCP. The API reads every change in every version. A fix pull request opens for the changes that reach a connected repository. Nothing merges or deploys.

Put your code on continuous maintenance.
Scan a public repository now, or give your agent one line.
See how out of date your code is.
Tell your agent what changed since it was trained.
claude mcp add --transport http since https://api.since.dev/mcpCodex, Cursor and any MCP client use https://api.since.dev/mcp.