-
Notifications
You must be signed in to change notification settings - Fork 960
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Misleading basename warning message #605
Comments
I just ran into this today as well. It looks like the issue is that A solution might be to use something like https://github.com/sindresorhus/escape-string-regexp to escape any such characters just before creating the regex to test. |
I think this is a duplicate of #564 |
Actually, it looks like there are half a dozen of the same issue. Earliest looks like #544 |
Half a dozen issues to go with the half a dozen PRs I guess 😛 |
I merged #544 yesterday. This will be fixed in the 4.10 release. |
Hello,
This is going to be quite considering the severance of the issue but maybe someone can point me somewhere though I know very well that the root of my main problem has nothing to do with the code in this repository. I just stumbled upon a minor issue during my research.
I am developing a React web application which needs to be called with a specific query string containing a parameter. My application needs to be integrated with a third-party proprietary component which renders a dynamic header and a footer in the application.
This header and footer contain
<a>
tags with the attributehref="#"
. Of course these links don't go anywhere but they haveonclick
handlers which expand/collapse menus etc. At least that's how they should work. But within the head there is a<base>
tag which's value is the relative path to the root of the application but without the query string. This tag is rendered on the server and this makes sure that the application works the same way in different environments (e.g. http://example.com and http://example.com/Foo as well without any modifications).However this gives me a headache right now as the relative anchor tags compute their absolute target urls relative to the base path. That does not include the query string and therefore upon clicking them the browser detects an URL change and performs a redirect instead of just appending the hashmark at the end of the URL.
So I have tried to modify the
<base href>
. If I change it in the inspector and append the query string, everything works fine. But if I change it in the code and try to load the application, nothing renders and there is no error message at all - except for a warning:My issue lies here: the warning message is simply not true, because the strings are identical and therefore they both begin with one another. I have found that the relevant check originally tested this exact condition (
indexOf... !== -1
) described in the warning message, but in a later commit it has been replaced with a more advanced logic with regex matching etc: (e075087#diff-f62943cda47e8992518ce1f1e28f38c1)But the warning message remained unchanged. I think this is misleading because it does not correctly describe the actual problem and states a fact which is false.
The text was updated successfully, but these errors were encountered: