You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to use match to match a given hash (from our client hash router) to a predefined set of paths, e.g. we have a path #/user/:id and I want to have #/user/123 produce a match. In addition we have a catch-all route, which is #/* which should produce a match when I pass in #/:
const{ match }=require('path-to-regexp')match('#/*')('#/')
but it fails with
TypeError: Unexpected MODIFIER at 2, expected END
at mustConsume (/home/runner/node_modules/path-to-regexp/dist/index.js:113:15)
at parse (/home/runner/node_modules/path-to-regexp/dist/index.js:172:9)
at stringToRegexp (/home/runner/node_modules/path-to-regexp/dist/index.js:329:27)
at pathToRegexp (/home/runner/node_modules/path-to-regexp/dist/index.js:403:12)
at match (/home/runner/node_modules/path-to-regexp/dist/index.js:248:14)
at /home/runner/index.js:3:1
at Script.runInContext (vm.js:133:20)
at Object.<anonymous> (/run_dir/interp.js:156:20)
at Module._compile (internal/modules/cjs/loader.js:778:30)
Hello!
I want to use
match
to match a given hash (from our client hash router) to a predefined set of paths, e.g. we have a path#/user/:id
and I want to have#/user/123
produce a match. In addition we have a catch-all route, which is#/*
which should produce a match when I pass in#/
:but it fails with
See this REPL: https://repl.it/repls/GenuineAssuredControlflowgraph
Is this a bug or is it not supported? Is there a workaround?
This occurs with v6 of your library, in previous version it seemed to be working.
Thanks for your help, I’m happy to share more information if needed!
The text was updated successfully, but these errors were encountered: