Skip to content

Error #1: Route path compilation failed

In production builds the console shows minified error #1 with a link to this page; in other environments you get a multi-line message with the same meaning.

Explanation

This happens inside Route.createUrl() when the route path pattern (via path-to-regexp compile) throws while building the path from the current params. Typical causes include missing or invalid path params for the template, or a malformed pattern.

The library catches the error and falls back to fallbackPath from the route or routeConfig fallbackPath, or to '/' if none is set.

Potential solutions

  • Ensure createUrl / open receives params that satisfy every dynamic segment in the route path.
  • Set a safe fallbackPath on the route or globally via routeConfig when params can be incomplete at runtime.
  • Inspect the exception logged as the second argument to console.error in non-production builds.

See also

Released under the MIT License.