Don't attempt to resolve URLs starting with '#' #6504
Merged
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.
↪️ Pull Request
This resolves the issue I came across in #6471 where Stylus files containing a rule like
clip-path: url('#clip-path')
caused the build to fail and throw an error (Received URL without a pathname #clip-path
).At first I thought the issue was coming from the
@parcel/transformer-stylus
package, but after digging into it I discovered the error is being thrown before the stylus transformer is hit.After looking around I came across this issue with
#
in paths of SVG files which was solved in #5188. I chose to updatePathRequest.js
to check if a path starts with#
and returnnull
if so.I can't think of any cases where we would want Parcel to attempt resolving a path starting with
#
, but I could be wrong.Let me know if there's a different path I should take or if there's any issues with my proposed fix.
Thanks!
💻 Examples
This is an example of a Stylus rule that causes Parcel to fail and is fixed by this PR:
🚨 Test instructions
✔️ PR Todo