-
-
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
Resolving CSS src:url() broken with relative public-url path #5333
Comments
@DeMoorJasper any idea that I could try for a workaround, even something like manually maintaining a mapping for defining the correct path to the asset? |
It's also listed twice in the source: src: url("../webfonts/fa-regular-400.eot");
src: url("../webfonts/fa-regular-400.eot?#iefix") ... https://unpkg.com/browse/@fortawesome/fontawesome-free@5.15.1/css/regular.css Also I don't see |
It‘s the same file plus query parameters. Why would that be an issue?
No. But the output folder is dist/ and css url()s are relative to the css file, so that makes- as the css urls are mapped to dist/ too- dist/dist/ which I see in the browser and does not exist. Imho the issue here is the css src: url() being resolved to the same relative path instead of . |
The same seems true for css source maps:
Any idea where I could look for fixing this instead of post-processing everything with |
Does this in any way relate to #336 or #850? /cc @devongovett Would appreciate any hint where to dig for a solution. |
Did you try removing the |
No, not yet. The docs at https://en.parceljs.org/cli.html#options seem to indicate that the public url can be a relative folder (which I do want) but which seems to have problems with path resolution. I‘ll retry without that option and report. UPDATE Using this instead of
leads to all asset links in dist to be prefixed by |
Here evcc-io/evcc#534 is another manifestation of the problem. Also @devongovett do you have any other ideas I could try? |
🐛 bug report
I'm running parcel build with relative path:
Fontawesome is included from
../node_modules
folder:When opening the page, all assets are resolved, however the relative path inside
regular.min.css
is resolved twice (seesrc:url(dist/fa-regular-400.6eacc
):The double
dist/dist/fa-regular...
cannot be resolved by the browser then. This is not a problem when using--public-url /dist
obviously but then the install is not portable.🎛 Configuration (.babelrc, package.json, cli command)
🤔 Expected Behavior
Relative
dist
should only be applied once and not twice inside the font css.😯 Current Behavior
The double
dist/dist/fa-regular...
cannot be resolved by the browser then. This is not a problem when using--public-url /dist
obviously but then the install is not portable.💁 Possible Solution
🔦 Context
💻 Code Sample
🌍 Your Environment
The text was updated successfully, but these errors were encountered: