Compiled assets have incorrect file path

Trying to use fancy new sage 8.2, I npm install, bower install and gulp with no other changes (so leaving it using sass), but the path to bootstrap glyphicon paths are wrong:

http://example.com/app/themes/sage/dist/styles/styles/fonts/bootstrap/glyphicons-halflings-regular.woff

Am I doing it wrong or is that a bug? I also don’t see the bootstrap js files included anywhere, but I think they’re baked into main.js after gulp – that sound right?

2 Likes

I’m having the same issue. Also getting the same issue with 8.1.1.

I’m also getting the same problem with web fonts in my _global.less/scss files. I had add “…/…/” in front of the normal url ex:

src: url(’…/…/…/fonts/Aleo-Regular-webfont.eot’);

usually the file path is src: url(’…/fonts/Aleo-Regular-webfont.eot’);

they were getting the same /style/style/ in their file path, when complied by gulp

Just did a fresh install of 8.1.0 and did not get this issue, and to double check I just did a fresh install of 8.1.1 and the bug was present, which seemed to confirm that this issue popped up in 8.1.1.

I was able to get around this with by adding this to common/_variables.scss:

$icon-font-path: "../../../fonts/";
1 Like

… but that won’t help you with your custom fonts, just the glyphicons. In compass there’s a setting for font path, but I dunno if that’s applicable here.

PR please! This is a super easy fix and a great way to contribute back to the project :wink:

I’m experiencing the same thing with using images, I’ve had to use ("…/…/…/images/ex.png") in _global.scss to get my images to link correctly. Is there a ‘relative’ path for all assets we can set?

I’m really confused.

CSS is compiled to dist/styles/

Images are compiled to dist/images/

You would never need to do ../../../images/ in your CSS. I just tested the following in _global.scss:

body {
  background: url(../images/example.png);
}

Works fine.

Turns out this is a new bug! Gross. Renamed the title of this thread to reflect the issue.

I’ve got it fixed over here: https://github.com/roots/sage/pull/1452

2 Likes

fantastic. Glad I’m not crazy :smile: