-
-
Notifications
You must be signed in to change notification settings - Fork 601
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
sourceMap css does not function for background-image (maybe stylus-loader issue) #29
Comments
The problem is that DataUrls cannot download resources... (The stylesheet is embedded as DataUrl to append the SourceMap) As workaround you could include every image as DataUrl (with the url-loader instead of the file-loader)... I'll try to find a better solution... |
Thank you. |
|
Its been a while; how would this look in the config? |
|
we are using stylus-loader and all the With this settings for the stylus-loader it's working: |
I just came across the same issue where background images from css don't work because of the paths, when using sourcemaps, css-loader and file-loader in dev mode with webpack-dev-server. For now I've simply disabled sourcemaps, but was there a better fix? |
I think a workaround is to use an absolute URL as |
#113 related; tried the pubicPath still didn't work. |
This issue is also failing with fonts as well. They are being declared as they cannot be decoded in chrome or firefox. Oddly it works fine in safari. |
Is there still no fix for this? Specifying an absolute path for |
Specify an absolute URL ( |
Right I am using This only happens when sourcemap is on. |
for me too :( |
Weird. Running into this too when output publicPath isn't set to the full URL. |
Setting |
This still seems to be an issue. Using webpack v1.12.14, css-loader v0.23.1. When sourcemaps are on, background-images will not work. Setting |
I can confirm that setting output: {
publicPath: 'http://localhost:5000/',
},
module: {
{
test: /\.styl$/,
exclude: /node_modules/,
loader: 'style!css?sourceMap!stylus?resolve url',
}, {
test: /\.css/,
loader: 'style!css?sourceMap',
}
} I write Stylus as follows: // using file-loader explicitly here as I have svg-inline-loader managing .svg files in config
background-image url('~!file!assets/patterns/grey.svg') It produces following output in generated css: background-image: url(http://localhost:5000/95d465435d15b4852261c1b7315c90ba.svg); which is proprely seen and parsed by the browser. |
Has this been fixed in another ticket? I can't seem to find anything. |
Still facing this problem. I dont want to set an absolute URL like |
I am having issues with this as well, hoping for a solution that doesn't involve setting an absolute url on publicPath. Webpack is pretty much useless as build tool in your development workflow if you cannot use source maps to understand what styles are needing to be adjusted when viewing an elements styling. |
Only solution that worked for me was to use sourceMaps with extract-text-webpack-plugin to extract css to own file + change devtool from "eval-source-map" to "source-map". Only problem now is that hot reload is veery slow because of high quality source maps. So this is viable only for staging or production environment :) |
Has this been resolved in the meantime? |
I faced this issue as well, I disabled source map as absolute URL in public path does not fix the problem. |
Hi I'm still having this issue. I was not able to resolve it by setting output.publicPath to an absolute URL either :( here is a repository I made demonstrating the problem: https://github.com/mhfowler/Webpack-Example/ When I remove sourceMap from the css-loader there is no issue. Any help is appreciated, or if you can identify in my webpack config that would be great. |
@mhfowler The same. |
@mhfowler Same issue. enable |
So this issue is bizarre and I hope I can make an example that does this.
I successful got sourceMaps to work with stylus-loader with
{ test: /\.styl$/, loader: 'style!css?sourceMap!stylus' }
However when
?sourceMap
is enabled all ourbackground url('whatever/sprite.png')
no longer work. When the ?sourceMap is removed all is well.I will make an example repo when I get the chance. Also let me know if this should be an issue on stylus-loader instead.
As for more info the css produced are identical except that sourcemap css is redirected via @import some url. The computed CSS reported by Chrome Debugger is identical, but using (Chrome Extension) CSSViewer reports different processed CSS. Which shows the missing sprite.
Also this problem exists in Firefox as well so I do not think it is a chrome issue.
The text was updated successfully, but these errors were encountered: