-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
🐛 Parcel fails to find dependencies if it contains spaces on the file name #873
Comments
I don’t thing it would be hard to implement this (especially now that we have our own resolver, but I don’t really know if it even makes sense to consider supporting filenames with spaces. |
The |
What I find it interesting is that Parcel does URL Encode it and make it a valid URL, but then fails to find the file. You can check on the error message on my first post:
I used HTML as an example because I thought it was an easier way to show off this behavior, but I've faced it first through a CSS file with several |
Parcel may be URL encoding it, but the name on the file system isn't encoding it. Because of this, the file resolution will fail when the |
We could decode the requires before resolving them, but not sure if it should even be a feature as Brandon mentioned it’s not valid url Sent with GitHawk |
This is very problematic with CSS links as well. Consider:
It cannot find that file because its looking for "Open%20Sans". In this case, we're not talking about a "URL," we're talking about a path to a resource that Parcel is supposed to scoop up and compile into its package. Please fix this. |
Actually I've also faced this issue when trying to use a font with CSS |
I've created a PR that fixes this, it seems like a valid use-case as the exposed filename for the browser is the one parcel generates anyways. |
🎛 Configuration
🤔 Expected Behavior
No errors.
😯 Current Behavior
Browser:
💁 Possible Solution
Accept spaces (
) on the file name, checking the file system before URL-encoding it to %20.
🔦 Context
I've received a front-end to work on, however it has a long CSS file with some background-images pointing to images with spaces on the file name.
💻 Code Sample
index.html
test file.js
🌍 Your Environment
The text was updated successfully, but these errors were encountered: