We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 960d9ad commit 90bf6f3Copy full SHA for 90bf6f3
src/matcher/pathTokenizer.ts
@@ -46,10 +46,11 @@ const VALID_PARAM_RE = /[a-zA-Z0-9_]/
46
export function tokenizePath(path: string): Array<Token[]> {
47
if (!path) return [[]]
48
if (path === '/') return [[ROOT_TOKEN]]
49
- // remove the leading slash
50
- if (__DEV__ && !path.startsWith('/')) {
+ if (!path.startsWith('/')) {
51
throw new Error(
52
- `Route path should start with a "/": "${path}" should be "/${path}". This will break in production.`
+ __DEV__
+ ? `Route paths should start with a "/": "${path}" should be "/${path}".`
53
+ : `Invalid path "${path}"`
54
)
55
}
56
0 commit comments