question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't see GlyphIcons for bootstrap-sass

See original GitHub issue

Hello everyone, Sorry if this is a know issue but I can’t make it work. I have just installed Laravel 5.4 with the purpose to use bootstrap-sass, the new laravel Mix, and some other features. I was developing using npm run watch, everything went Ok until I used a GlyphIcon class in my html, it doesn’t show. My google chrome console throw a 404 on each typography. I read a lot about this issue, some recommend to modify the webpack.config.js file which I did but it still doesn’t work. I have the latest laravel mix version (0.10.0), my _variable.scss have the $icon-font-path: "~bootstrap-sass/assets/fonts/bootstrap/"; variable. I tried npm run watch, npm run dev, npm run production but none of those work. What else I can do? Please help!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11

github_iconTop GitHub Comments

4reactions
Corben78commented, Jan 12, 2018

This is my actual setting, it’s even easier…

resources/assets/sass/_variables.scss:

$icon-font-path: "../fonts/vendor/bootstrap-sass/bootstrap/";

webpack.mix.js:

mix.js('resources/assets/js/app.js', 'public/js')
   .sass('resources/assets/sass/app.scss', 'public/css')
   .options({
        processCssUrls: false
   });
3reactions
Corben78commented, Nov 10, 2017

Same problem for me with Laravel 5.5 and laravel-mix 1.6.1 I’ve read https://github.com/JeffreyWay/laravel-mix/issues/658 and https://github.com/JeffreyWay/laravel-mix/issues/881, and it seems that the setting publicPath in webpack.config.js has moved, so I couldn’t find it. I am not using a virtual host, where the laravel application is in the root folder, but a subfolder on my apache2 webserver. I’ve configured the directory and path through an apache2 config file, so htaccess works, meaning laravel is working perfectly in general, but the path to the fonts set by laravel mix is wrong. It creates an absolute path, where a relative path is needed.

Now after each npm run dev I have to manually set the path, which is not the desired procedure. So what do I have to do to get eventually a relative path in app.css?

edit: I had processCssUrls set to true, when setting it to false, I can use $icon-font-path to my needs, e.g.

webpack.mix.js:

var paths = {
	'bootstrap': './node_modules/bootstrap-sass/assets/'
}

mix.js('resources/assets/js/app.js', 'public/js')
	.sass('resources/assets/sass/app.scss', 'public/css', {
		includePaths: [
			paths.bootstrap + 'stylesheets/'
		]
	}).options({
		processCssUrls: false
	}).copyDirectory( paths.bootstrap + 'fonts/bootstrap/', 'public/fonts/bootstrap' );

resources/assets/sass/_variables.scss:

$icon-font-path: "../fonts/bootstrap/";
Read more comments on GitHub >

github_iconTop Results From Across the Web

Some Glyphicons not working with bootstrap-sass
According to this post there as a problem with some glyphicons not working but the problem was fixed in bootstrap-sass.
Read more >
Can't see GlyphIcons for bootstrap-sass · Issue #707 - GitHub
I have just installed Laravel 5.4 with the purpose to use bootstrap-sass, the new laravel Mix, and some other features.
Read more >
Getting started - Bootstrap
Read through to see what suits your particular needs. ... If you're compiling Bootstrap from its Less/Sass source and not using our Gruntfile, ......
Read more >
Glyph icons not working with Bootstrap subtheme - Drupal
Glyph icons aren't working on a Bootstrap subtheme. The markup is all there, but the font doesn't seem to load.
Read more >
Bootstrap Sass & resolve-url-loader - SymfonyCasts
Next, for the CSS require, we need to find the new path. Look inside node_modules/ for bootstrap-sass . Ok! It has an assets/stylesheets/_bootstrap.scss...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found