Syden
Syden

Reputation: 8625

Bootstrap 4 SCSS compilation: Error: Invalid US-ASCII character "\xE2"

Having issues compiling some bootstrap 4 modules (updating from beta3).

While the issue can be solved by setting @charset: 'UTF-8'; on _hover.scss mixin partial (which is noted as deprecated within the file), why would that be needed considering it should compile out of the box as previous beta versions.

Code in _hover.scss:

@mixin hover {
  &:hover { @content; }
}

@mixin hover-focus {
  &:hover,
  &:focus {
    @content;
  }
}

@mixin plain-hover-focus {
  &,
  &:hover,
  &:focus {
    @content;
  }
}

@mixin hover-focus-active {
  &:hover,
  &:focus,
  &:active {
    @content;
  }
}

enter image description here

After going through SCSS files can't figure exactly what's wrong, quotes seem ok.

Upvotes: 2

Views: 1827

Answers (2)

mrmoree
mrmoree

Reputation: 402

I ran into the same charset problem.

Especially on OSX there seams to be a problem with ruby Encoding Settings.

I fixed it creating a config.rb file in the main project directory to tell ruby explicitly which charset encoding it should use. Since sass and compass depend on ruby, chances good that this will fix your problems.

Encoding.default_external = 'utf-8'

Upvotes: 1

Syden
Syden

Reputation: 8625

After going through it in detail seems to be the - character on top comments ("iOS-an issue..").

One can replace it for their own - character and should compile fine (or just add @charset: 'UTF-8'; at the top of the _hover.scss mixin file).

Issue report: https://github.com/twbs/bootstrap/issues/25391

enter image description here

Upvotes: 1

Related Questions