-
-
Notifications
You must be signed in to change notification settings - Fork 605
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
problem with background url #256
Comments
I think one of the following should work:
(this one may need webpack resolve.root set to 'src') I will doublecheck a bit later |
Same issue here. Tried for hours to tweak config settings, and nothing worked. This seems to be happening quite a bit with this loader. The system should be more forgiving. |
+1 |
Same here... it seems the browser doesn't even request the url |
👍 Same here - issue is that the url doesn't work when using an external image, but does work when the image is inlined base64 encoded. |
@psimyn I tried the solutions you've given, but nothing works. Interestingly, prefixing the url with |
Is there any solution yet? |
@kumarharsh have you set publicPath in webpack config? I've used leading slash when setting publicPath and it works ok |
@psimyn yes, I'm using publicPath as |
I am having the same issue. Have tried different publicPath and setting root for css-loader with no luck. It works when sourceMap is disabled. But doesn't work when sourceMap is not disabled. here is my webpack config, any help is appreciated: https://github.com/mhfowler/Webpack-Example/blob/master/webpack.config.babel.js |
Same problem here. Tried to use |
Hey, it was I found similar problems here: Ref1: #232 In my case, it did get fixed when I removed |
You can also try using Notably: |
Add ?url=false to your css-loader, that will disable url handling :
|
If you try to use ~ before your path to the image. Like this:
|
@JacobWay could you please specify where exactly said line has to go? The only place where I find the token |
@Harti wepack.config = {
resolve: {
...
}
} |
@onepixelcitizen awesome man, you save my life. |
@onepixelcitizen it works! |
This started happening again today. |
In my case, the background image is inserted as an |
@volkanunsal downgrade |
@evilebottnawi Thank you! |
@evilebottnawi @d3viant0ne Is there a recommended solution for this problem given that the thread has many different possible solutions? What is the recommended way of using local images as background image urls? |
I don't think this should have been closed. There is lots of confusion around the issue still, and no official recommended way to resolve it. |
Solution: vuejs/vue-loader#481 |
@egeersoz I agree. @lndj - thanks for the link, it worked for me. For anyone put off by an unfamiliar character set: if (options.extract) {
return ExtractTextPlugin.extract({
use: loaders,
publicPath: '../../', // The magic smoke
fallback: 'vue-style-loader'
})
} else {
return ['vue-style-loader'].concat(loaders)
} |
Closing due to inactivity. Also we have many difference problem here, please create new issue if you have problem (with minimum reproducible test repo). Thanks! |
Hi,
I'm having a problem when loading a image with url(). I would like to have
background: url(../build/images/brew.jpg);
but in app.css I havebackground: url(/images/bg.jpg);
I tried the 'root' attribute from the doc but it's doesn't work...
What I'm doing wrong ? 😢
base.scss :
background: url('../images/bg.jpg');
app.css
background: url(/images/bg.jpg);
There is my src folder :
There is my build folder :
my webpack config
Thanks !
The text was updated successfully, but these errors were encountered: