Missing param due to case-sensitive token regex
See original GitHub issueVersion
3.1.3
Reproduction link
https://jsfiddle.net/j4s8ka1v/
Steps to reproduce
Unfortunately the above reproduction link does not reproduce the issue, not sure why the tokensToFunction method isnt used in the jsfiddle. But I’ve traced the issue to tokensToFunction
from path-to-regexp
. The issue seems to have been fixed in v3.1.0 due to this pr. You can check eg dist/vue-router.esm.js
to see the RegExp does not set the i
modifier
That makes this report more or less a fyi / request to upgrade path-to-regexp
😃
Locally the error is caused by a route similar to
routes: [{
path: "/:locale(en|pt-br)?/:source(.*)?",
component: myComponent,
}],
which fails when you browse to e.g. /pt-BR/path
:
What is expected?
That the token / param is matched case-insensitively
What is actually happening?
It doesnt, causing a missing param error
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Is there an alternative to string.Replace that is case-insensitive?
It's best to use: string value = Regex.Replace("%PolicyAmount%", Regex.Escape("%PolicyAmount%"), "$0".Replace("$", " ...
Read more >JSON is Case Sensitive. You Don't Have to Be. - Couchbase
In this article, we'll discuss dealing with data case sensitivity. Your field references are still case sensitive. If you use the wrong case...
Read more >How-To: Case-Insensitive Searches - Humio Documentation
It is possible to set the default for searching repositories to case-insensitive. To do this, first do a search as shown in the...
Read more >re — Regular expression operations — Python 3.11.1 ...
A regular expression (or RE) specifies a set of strings that matches it; the functions in this module let you check if a...
Read more >Working with regex match conditions - AWS Documentation
A regex match condition is a type of string match condition that identifies the pattern that you want to ... Query parameter name...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
fyi: path-to-regexp
v1.8.0
has been released which includes the backported tokenstofunctionoptions fix by @boringamefixed by #3032