Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey! Unfortunately this isn't the correct fix — the
href
property includes the query string and that's the part we are trying to drop here.I think the correct fix is going to be something like:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will try that change and make the appropriate updates to the PR
meanwhile I would like to ask if this is intended to run outside of a node environment. under what circumstances would there ever be a hash/query params. it would really help to understand how I could have caught this use case earlier
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, now the failed tests make more sense
I'll get right on those changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah the only time it happens is in some build tools like Vite that proxy URLs to the file system and add query string information. For example in Vite it might make a request for a Vue file just to get the CSS portion using a path that's sort of like this if I remember correctly:
http://localhost:3000/@/src/App.vue?lang=css
That gets converted to a file name when passed in to PostCSS and the query string is preserved, so we need to chop it off.