twbs / bootstrap-sass

Official Sass port of Bootstrap 2 and 3.
http://getbootstrap.com/css/#sass
MIT License
12.59k stars 3.53k forks source link

Build fails: Unclosed string #1214

Closed artfulrobot closed 3 years ago

artfulrobot commented 3 years ago

This crashes:

@import "~bootstrap-sass/assets/stylesheets/bootstrap/variables";   
@import "~bootstrap-sass/assets/stylesheets/bootstrap/mixins";      
@import "~bootstrap-sass/assets/stylesheets/bootstrap/glyphicons";
Module build failed (from ./node_modules/css-loader/index.js):                  
ModuleBuildError: Module build failed (from ./node_modules/css-loader/index.js):
Unclosed string (5:12478)                                                       

It points at:

.glyphicon-menu-up:before{content:"\e260"}
                                        ^ 

but that looks fine to me.

I only get this in production mode. I'm using node v14.15.1npm (having had the same problem on 12.x so upgraded) npm 6.14.8, Laravel Mix 5.0.9, node-sass 4.14.1, css-loader 1.0.1...

artfulrobot commented 3 years ago

Closing because I found that the error was something to do with the $bootstrap-sass-asset-helper variable. When this was true I was getting this error because the CSS output did indeed ommit a " character from the end of a font path. I suspect this was a local config problem; I notice that twbs-font-path() was being used but not defined.

I have stopped using $bootstrap-sass-asset-helper and instead now set $icon-font-path: '~bootstrap-sass/assets/fonts/bootstrap/'; which seems to work fine.