Compass sourcemaps causing 404

183 views Asked by At

I've googled and read webpages till my eyes bled, but still can't find the answer. So please excuse me if this has been answered already.

My compass project grunt "compiles" just fine for production and development "modes". The souremaps work when using chrome. HOWEVER, Chrome is reporting 404 errors for all the compass library/ core files.

Here are the 404s: https://i.stack.imgur.com/Kyqq6.jpg

I can see from the source map file where the problem is but don't know how to fix it. Here is the style.css.map file:

{
"version": 3,
"mappings": "..snip-snip..",
"sources": ["../sass/_print.scss","../../../../../../../../../usr/local/rvm/gems/ruby-2.1.2/gems/compass-core-1.0.1/stylesheets/compass/typography/_units.scss","../sass/components/_colors.scss","../sass/components/_fonts.scss","../sass/components/_header.scss","../sass/components/_misc.scss","../sass/_mixins.scss","../../../../../../../../../usr/local/rvm/gems/ruby-2.1.2/gems/compass-core-1.0.1/stylesheets/compass/utilities/general/_clearfix.scss","../../../../../../../../../usr/local/rvm/gems/ruby-2.1.2/gems/compass-core-1.0.1/stylesheets/compass/utilities/general/_hacks.scss","../../../../../../../../../usr/local/rvm/gems/ruby-2.1.2/gems/compass-core-1.0.1/stylesheets/compass/css3/_images.scss","../../../../../../../../../usr/local/rvm/gems/ruby-2.1.2/gems/compass-core-1.0.1/stylesheets/compass/typography/_vertical_rhythm.scss","../../../../../../../../../usr/local/rvm/gems/ruby-2.1.2/gems/compass-core-1.0.1/stylesheets/compass/_support.scss","../../../../../../../../../usr/local/rvm/gems/ruby-2.1.2/gems/compass-core-1.0.1/stylesheets/compass/css3/_text-shadow.scss","../sass/_init.scss","../../../../../../../../../usr/local/rvm/gems/ruby-2.1.2/gems/compass-core-1.0.1/stylesheets/compass/css3/_transition.scss","../../../../../../../../../usr/local/rvm/gems/ruby-2.1.2/gems/compass-core-1.0.1/stylesheets/compass/css3/_border-radius.scss","../../../../../../../../../usr/local/rvm/gems/ruby-2.1.2/gems/compass-core-1.0.1/stylesheets/compass/css3/_appearance.scss","../sass/_normalize.scss","../../../../../../../../../usr/local/rvm/gems/ruby-2.1.2/gems/compass-core-1.0.1/stylesheets/compass/css3/_box-sizing.scss","../sass/layouts/_fixed.scss","../sass-extensions/zen-grids/stylesheets/zen/_grids.scss","../sass/styles.scss","../../../../../../../../../usr/local/rvm/gems/ruby-2.1.2/gems/compass-core-1.0.1/stylesheets/compass/css3/_box-shadow.scss","../../../../../../../../../usr/local/rvm/gems/ruby-2.1.2/gems/compass-core-1.0.1/stylesheets/compass/css3/_transform.scss"],
"names": [],
"file": "styles.css"
}

So all the "../../../.." are causing 404 errors during development which is super annoying. Basically the paths that compass is generating are not valid.

Does anyone know how to get compass to behave so this doesn't happen? I assume its a setting in my config.rb that's neccessary but I don't know which one: http://compass-style.org/help/documentation/configuration-reference/

Here's my config.rb:

#
# Change this to :production when ready to deploy the CSS to the live server.
#environment = :production
firesass = (environment == :development) ? true : false
css_dir         = "css"
sass_dir        = "sass"
add_import_path  "sass/components"
extensions_dir  = "sass-extensions"
images_dir      = "images"
javascripts_dir = "js"
output_style = (environment == :development) ? :expanded : :compressed
relative_assets = true
sass_options = (environment == :development && firesass == true) ? {:debug_info => true} : {}
#
# When true this will cause errors for trying to download files from $base_url/usr/local/rvm/gems/ruby-2.1.2/gems/compass-core-1.0.1/stylesheets/compass/_support.scss
# Errors go away when set to false (in production)
sourcemap = (environment == :development) ? true : false

Most of the examples out there on the web give instructions for telling Chrome where your local instances are but my local instance is on a vm host and not a Mamp host that shares a filesystem - so the examples don't help.

And just to be clear - the source maps are working for non-compass core files. And by working I mean - Not throwing 404's and pointing to the right source lines in the developer inspector.

Many thanks for any help.

Dan

ps. I've tried gem uninstall/install for both sass and compass -- that didn't seem to help.

0

There are 0 answers