question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missing param due to case-sensitive token regex

See original GitHub issue

Version

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:

image

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:closed
  • Created 4 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
pimliecommented, Nov 11, 2019

fyi: path-to-regexp v1.8.0 has been released which includes the backported tokenstofunctionoptions fix by @boringame

0reactions
posvacommented, May 11, 2020

fixed by #3032

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found