---
title: "path-to-regexp 9.0.0 Breaking Changes on npm | Since.dev"
description: "What each path-to-regexp release removed, renamed or changed: 151 breaking changes in 29 versions on npm, each with its source."
canonical_url: https://since.dev/packages/npm/path-to-regexp
last_updated: 2026-12-04
---

# path-to-regexp breaking changes

path-to-regexp 9.0.0 (October 22, 2026) is its newest release with breaking changes, 12 of them. The first: Removed Keys. Every breaking API change we have recorded in path-to-regexp on npm: 151 breaking changes in 29 versions. Below, its 29 versions with breaking changes, newest first, removals and renames first, each with its source.

Updated December 4, 2026

Latest version `9.0.1`, released December 4, 2026. [Source repository](https://github.com/pillarjs/path-to-regexp)

Packages on npm run on Node.js. [Node.js end of life dates](https://since.dev/calendar/nodejs.md).

- From [8.4.2](#v-8-4-2) to [9.0.0](#v-9-0-0): 12 breaking changes in 1 version.
- From [0.2.0](#v-0-2-0) to [9.0.0](#v-9-0-0): 149 breaking changes in 28 versions.

## path-to-regexp 9.0.0 breaking changes

path-to-regexp 9.0.0, released October 22, 2026: 12 breaking changes.

- **Removed** `Keys`  

The Keys type is no longer exported. Code that references it must be updated. [npmjs.com](https://www.npmjs.com/package/path-to-regexp/v/9.0.0)
- **Removed** `TokenData.constructor`  

new TokenData() was removed in path-to-regexp 9.0.0 [npmjs.com](https://www.npmjs.com/package/path-to-regexp/v/9.0.0)
- **Behavior changed**  

A path that already includes a trailing delimiter no longer gets an extra optional delimiter appended when matching. [github.com](https://github.com/pillarjs/path-to-regexp/releases/tag/v9.0.0)
- **Behavior changed** `compile`  

Passing an empty string as a param to compile now throws instead of producing output. [github.com](https://github.com/pillarjs/path-to-regexp/releases/tag/v9.0.0)
- **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](https://github.com/pillarjs/path-to-regexp/releases/tag/v9.0.0)
- **Configuration changed**  

The package now requires Node.js 22 or newer. [github.com](https://github.com/pillarjs/path-to-regexp/releases/tag/v9.0.0)
- **Configuration changed**  

The package is built as ES modules only. Code that loads it with require() must switch to import. [github.com](https://github.com/pillarjs/path-to-regexp/releases/tag/v9.0.0)
- **Signature changed** `Group.tokens`  

Was tokens: Token\[\]; now tokens: readonly Token\[\]. [npmjs.com](https://www.npmjs.com/package/path-to-regexp/v/9.0.0)
- **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](https://www.npmjs.com/package/path-to-regexp/v/9.0.0)
- **Signature changed** `TokenData`  

The TokenData class is no longer exported. Code that imports or uses it must be updated. [npmjs.com](https://www.npmjs.com/package/path-to-regexp/v/9.0.0)
- **Signature changed** `TokenData.originalPath`  

Was readonly originalPath?: string | undefined; now originalPath?: string. [npmjs.com](https://www.npmjs.com/package/path-to-regexp/v/9.0.0)
- **Signature changed** `TokenData.tokens`  

Was readonly tokens: Token\[\]; now tokens: readonly Token\[\]. [npmjs.com](https://www.npmjs.com/package/path-to-regexp/v/9.0.0)

## path-to-regexp 8.4.2 breaking changes

path-to-regexp 8.4.2, released April 1, 2026: 1 breaking change.

- **Behavior changed**  

A trailing backslash in a path pattern now produces an error. Make sure patterns do not end with a backslash. [github.com](https://github.com/pillarjs/path-to-regexp/releases/tag/v8.4.2)

## path-to-regexp 8.4.0 breaking changes

path-to-regexp 8.4.0, released March 26, 2026: 1 breaking change.

- **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](https://github.com/pillarjs/path-to-regexp/releases/tag/v8.4.0)

## path-to-regexp 8.3.0 breaking changes

path-to-regexp 8.3.0, released September 2, 2025: 4 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](https://github.com/pillarjs/path-to-regexp/releases/tag/v8.3.0)
- **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](https://github.com/pillarjs/path-to-regexp/releases/tag/v8.3.0)
- **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](https://www.npmjs.com/package/path-to-regexp/v/8.3.0)
- **Signature changed** `TokenData.constructor`  

Was constructor(tokens: Token\[\]); now constructor(tokens: Token\[\], originalPath?: string | undefined). [npmjs.com](https://www.npmjs.com/package/path-to-regexp/v/8.3.0)

## path-to-regexp 8.1.0 breaking changes

path-to-regexp 8.1.0, released September 10, 2024: 2 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](https://www.npmjs.com/package/path-to-regexp/v/8.1.0)
- **Signature changed** `MatchOptions`  

Was interface MatchOptions; now interface MatchOptions extends PathToRegexpOptions. [npmjs.com](https://www.npmjs.com/package/path-to-regexp/v/8.1.0)

## path-to-regexp 8.0.0 breaking changes

path-to-regexp 8.0.0, released September 1, 2024: 25 breaking changes.

- **Removed**  

Only the optional group suffix \`?\` still works. Use wildcards in place of \`+\`, and \`{\*foo}\` in place of \`\*\`. [github.com](https://github.com/pillarjs/path-to-regexp/releases/tag/v8.0.0)
- **Removed**  

Parameters can no longer be given custom regular expression overrides. Code using them must be changed. [github.com](https://github.com/pillarjs/path-to-regexp/releases/tag/v8.0.0)
- **Removed**  

The loose mode option is no longer available. Code relying on it must be changed. [github.com](https://github.com/pillarjs/path-to-regexp/releases/tag/v8.0.0)
- **Removed** `CompileOptions.encodePath`  

CompileOptions.encodePath was removed in path-to-regexp 8.0.0 [npmjs.com](https://www.npmjs.com/package/path-to-regexp/v/8.0.0)
- **Removed** `CompileOptions.loose`  

CompileOptions.loose was removed in path-to-regexp 8.0.0 [npmjs.com](https://www.npmjs.com/package/path-to-regexp/v/8.0.0)
- **Removed** `CompileOptions.sensitive`  

CompileOptions.sensitive was removed in path-to-regexp 8.0.0 [npmjs.com](https://www.npmjs.com/package/path-to-regexp/v/8.0.0)
- **Removed** `CompileOptions.strict`  

CompileOptions.strict was removed in path-to-regexp 8.0.0 [npmjs.com](https://www.npmjs.com/package/path-to-regexp/v/8.0.0)
- **Removed** `CompileOptions.validate`  

CompileOptions.validate was removed in path-to-regexp 8.0.0 [npmjs.com](https://www.npmjs.com/package/path-to-regexp/v/8.0.0)
- **Removed** `Key`  

Key was removed in path-to-regexp 8.0.0 [npmjs.com](https://www.npmjs.com/package/path-to-regexp/v/8.0.0)
- **Removed** `MatchOptions.encodePath`  

MatchOptions.encodePath was removed in path-to-regexp 8.0.0 [npmjs.com](https://www.npmjs.com/package/path-to-regexp/v/8.0.0)

And 15 more in this version. [Sign up to see every change](https://app.since.dev/login?mode=signup&src=package-page)

## Older versions

23 older versions, each with its first changes. [Sign up to see every change](https://app.since.dev/login?mode=signup&src=package-page)

### path-to-regexp 7.2.0 breaking changes

path-to-regexp 7.2.0, released September 10, 2024: 2 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](https://www.npmjs.com/package/path-to-regexp/v/7.2.0)
- **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](https://www.npmjs.com/package/path-to-regexp/v/7.2.0)

### path-to-regexp 7.1.0 breaking changes

path-to-regexp 7.1.0, released July 13, 2024: 2 breaking changes.

- **Removed** `PathRegExp`  

PathRegExp was removed in path-to-regexp 7.1.0 [npmjs.com](https://www.npmjs.com/package/path-to-regexp/v/7.1.0)
- **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](https://www.npmjs.com/package/path-to-regexp/v/7.1.0)

### path-to-regexp 7.0.0 breaking changes

path-to-regexp 7.0.0, released June 20, 2024: 36 breaking changes.

- **Removed**  

Arrays and regular expressions are no longer supported as inputs. Pass string paths instead. [github.com](https://github.com/pillarjs/path-to-regexp/releases/tag/v7.0.0)
- **Removed**  

The package is now shipped only as a single CommonJS export instead of an ESM and CommonJS dual package. [github.com](https://github.com/pillarjs/path-to-regexp/releases/tag/v7.0.0)

And 34 more in this version.

### path-to-regexp 6.3.0 breaking changes

path-to-regexp 6.3.0, released September 12, 2024: 1 breaking change.

- **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](https://github.com/pillarjs/path-to-regexp/releases/tag/v6.3.0)

### path-to-regexp 6.1.0 breaking changes

path-to-regexp 6.1.0, released November 20, 2019: 1 breaking change.

- **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](https://github.com/pillarjs/path-to-regexp/releases/tag/v6.1.0)

### path-to-regexp 6.0.0 breaking changes

path-to-regexp 6.0.0, released November 20, 2019: 7 breaking changes.

- **Removed** `Key.delimiter`  

Key.delimiter was removed in path-to-regexp 6.0.0 [npmjs.com](https://www.npmjs.com/package/path-to-regexp/v/6.0.0)
- **Removed** `Key.optional`  

Key.optional was removed in path-to-regexp 6.0.0 [npmjs.com](https://www.npmjs.com/package/path-to-regexp/v/6.0.0)

And 5 more in this version.

### path-to-regexp 5.0.0 breaking changes

path-to-regexp 5.0.0, released November 12, 2019: 6 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](https://www.npmjs.com/package/path-to-regexp/v/5.0.0)
- **Renamed** `RegexpOptions`  

The RegexpOptions interface is renamed to TokensToRegexpOptions. Update any type imports or annotations that use the old name. [npmjs.com](https://www.npmjs.com/package/path-to-regexp/v/5.0.0)

And 4 more in this version.

### path-to-regexp 4.0.5 breaking changes

path-to-regexp 4.0.5, released November 12, 2019: 2 breaking changes.

- **Removed** `whitelist`  

The whitelist option is gone. Use decodeURI instead, or handle advanced behavior outside path-to-regexp. [github.com](https://github.com/pillarjs/path-to-regexp/releases/tag/v4.0.5)
- **Signature changed** `normalizePathname`  

Was function normalizePathname(pathname: string, whitelist?: string | string\[\]): string; now function normalizePathname(pathname: string): string. [npmjs.com](https://www.npmjs.com/package/path-to-regexp/v/4.0.5)

### path-to-regexp 4.0.4 breaking changes

path-to-regexp 4.0.4, released November 12, 2019: 1 breaking change.

- **Signature changed** `parse`  

Was function parse(input: string, options?: ParseOptions): Token\[\]; now function parse(str: string, options?: ParseOptions): Token\[\]. [npmjs.com](https://www.npmjs.com/package/path-to-regexp/v/4.0.4)

### path-to-regexp 4.0.3 breaking changes

path-to-regexp 4.0.3, released November 12, 2019: 1 breaking change.

- **Signature changed** `normalizePathname`  

Was function normalizePathname(pathname: string): string; now function normalizePathname(pathname: string, whitelist?: string | string\[\]): string. [npmjs.com](https://www.npmjs.com/package/path-to-regexp/v/4.0.3)

### path-to-regexp 4.0.2 breaking changes

path-to-regexp 4.0.2, released November 12, 2019: 1 breaking change.

- **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](https://www.npmjs.com/package/path-to-regexp/v/4.0.2)

### path-to-regexp 4.0.1 breaking changes

path-to-regexp 4.0.1, released November 12, 2019: 3 breaking changes.

- **Removed** `tokensToRegExp`  

tokensToRegExp was removed in path-to-regexp 4.0.1 [npmjs.com](https://www.npmjs.com/package/path-to-regexp/v/4.0.1)
- **Renamed** `RegExpOptions`  

Use RegexpOptions instead. [npmjs.com](https://www.npmjs.com/package/path-to-regexp/v/4.0.1)

And 1 more in this version.

### path-to-regexp 4.0.0 breaking changes

path-to-regexp 4.0.0, released November 12, 2019: 13 breaking changes.

- **Removed** `default`  

default was removed in path-to-regexp 4.0.0 [npmjs.com](https://www.npmjs.com/package/path-to-regexp/v/4.0.0)
- **Removed** `MatchFunctionOptions`  

MatchFunctionOptions was removed in path-to-regexp 4.0.0 [npmjs.com](https://www.npmjs.com/package/path-to-regexp/v/4.0.0)

And 11 more in this version.

### path-to-regexp 3.3.0 breaking changes

path-to-regexp 3.3.0, released September 10, 2024: 1 breaking change.

- **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](https://github.com/pillarjs/path-to-regexp/releases/tag/v3.3.0)

### path-to-regexp 3.1.0 breaking changes

path-to-regexp 3.1.0, released August 31, 2019: 2 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](https://www.npmjs.com/package/path-to-regexp/v/3.1.0)
- **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](https://www.npmjs.com/package/path-to-regexp/v/3.1.0)

### path-to-regexp 3.0.0 breaking changes

path-to-regexp 3.0.0, released January 14, 2019: 5 breaking changes.

- **Removed** `Key.partial`  

Key.partial was removed in path-to-regexp 3.0.0 [npmjs.com](https://www.npmjs.com/package/path-to-regexp/v/3.0.0)
- **Removed** `ParseOptions.delimiters`  

ParseOptions.delimiters was removed in path-to-regexp 3.0.0 [npmjs.com](https://www.npmjs.com/package/path-to-regexp/v/3.0.0)

And 3 more in this version.

### path-to-regexp 2.2.0 breaking changes

path-to-regexp 2.2.0, released March 7, 2018: 1 breaking change.

- **Signature changed** `PathFunctionOptions.encode`  

Was encode?: (value: string) => string; now encode?: (value: string, token: Key) => string. [npmjs.com](https://www.npmjs.com/package/path-to-regexp/v/2.2.0)

### path-to-regexp 2.0.0 breaking changes

path-to-regexp 2.0.0, released August 23, 2017: 8 breaking changes.

- **Removed** `Key.asterisk`  

Key.asterisk was removed in path-to-regexp 2.0.0 [npmjs.com](https://www.npmjs.com/package/path-to-regexp/v/2.0.0)
- **Removed** `PathFunctionOptions.pretty`  

PathFunctionOptions.pretty was removed in path-to-regexp 2.0.0 [npmjs.com](https://www.npmjs.com/package/path-to-regexp/v/2.0.0)

And 6 more in this version.

### path-to-regexp 1.9.0 breaking changes

path-to-regexp 1.9.0, released September 10, 2024: 2 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](https://github.com/pillarjs/path-to-regexp/releases/tag/v1.9.0)
- **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](https://github.com/pillarjs/path-to-regexp/releases/tag/v1.9.0)

### path-to-regexp 1.8.0 breaking changes

path-to-regexp 1.8.0, released November 11, 2019: 2 breaking changes.

- **Signature changed** `compile`  

Was function compile (path: string, options?: ParseOptions): PathFunction; now function compile (path: string, options?: ParseOptions & TokensToFunctionOptions): PathFunction. [npmjs.com](https://www.npmjs.com/package/path-to-regexp/v/1.8.0)
- **Signature changed** `tokensToFunction`  

Was function tokensToFunction (tokens: Token\[\]): PathFunction; now function tokensToFunction (tokens: Token\[\], options?: TokensToFunctionOptions): PathFunction. [npmjs.com](https://www.npmjs.com/package/path-to-regexp/v/1.8.0)

### path-to-regexp 1.6.0 breaking changes

path-to-regexp 1.6.0, released October 3, 2016: 5 breaking changes.

- **Removed** `Options`  

Options was removed in path-to-regexp 1.6.0 [npmjs.com](https://www.npmjs.com/package/path-to-regexp/v/1.6.0)
- **Signature changed** `compile`  

Was function compile (path: string): PathFunction; now function compile (path: string, options?: ParseOptions): PathFunction. [npmjs.com](https://www.npmjs.com/package/path-to-regexp/v/1.6.0)

And 3 more in this version.

### path-to-regexp 0.2.2 breaking changes

path-to-regexp 0.2.2, released July 6, 2014: 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](https://github.com/pillarjs/path-to-regexp/blob/v0.2.2/History.md)
- **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](https://github.com/pillarjs/path-to-regexp/blob/v0.2.2/History.md)

### path-to-regexp 0.2.0 breaking changes

path-to-regexp 0.2.0, released June 10, 2014: 2 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](https://github.com/pillarjs/path-to-regexp/blob/v0.2.0/History.md)
- **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](https://github.com/pillarjs/path-to-regexp/blob/v0.2.0/History.md)

## Check your code

These are the changes. To see which of them reach your code, [scan a public repository](https://since.dev/scan.md), or have your coding agent call `check_code` with your manifest or lockfile over [MCP](https://since.dev/docs.md#mcp). [The API](https://since.dev/docs.md#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.

[Scan a repository](https://since.dev/scan.md). Any public GitHub repository. No sign-in.

### Tell your agent what changed since it was trained.

`claude mcp add --transport http since https://api.since.dev/mcp`

[Get an API key](https://app.since.dev/login?mode=signup)

Codex, Cursor and any MCP client use https://api.since.dev/mcp.

---

Every page on this site as Markdown: https://since.dev/sitemap.md. For agents: https://since.dev/llms.txt.
