rsnext/errors/invalid-route-source.md
JJ Kasper 163f607160
Add parsing of route source during checking (#9787)
* Add parsing of route during checking

* Update err.sh
2019-12-19 10:48:34 -06:00

755 B

Invalid Custom Route source

Why This Error Occurred

When defining custom routes a route was added that causes an error during parsing. This can be due to trying to use normal RegExp syntax like negative lookaheads (?!exclude) without following path-to-regexp's syntax for it.

Possible Ways to Fix It

Wrap the RegExp part of your source as an un-named parameter.

Before

{
  source: '/feedback/(?!general)',
  destination: '/feedback/general'
}

After

{
  source: '/feedback/((?!general).*)',
  destination: '/feedback/general'
}