Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

node-sass cannot compile bootstrap4.0.0-beta.2 #2188

Closed
pwoosam opened this issue Dec 15, 2017 · 6 comments
Closed

node-sass cannot compile bootstrap4.0.0-beta.2 #2188

pwoosam opened this issue Dec 15, 2017 · 6 comments

Comments

@pwoosam
Copy link

pwoosam commented Dec 15, 2017

Bootstrap 4 fails to compile

It seems that libsass has an issue with compiling compound ampersands "&".

It looks like the only options are to either use an older version of node-sass or use another sass compiler... Has there really been no fix yet?

Has anyone been able to get bootstrap 4 to compile using node-sass?
Is there a beta version of node-sass that uses an alternative to libsass or an updated libsass that functions properly?

System info

NPM version: 5.6.0
Node version: 9.3.0
Node process:

{ http_parser: '2.7.0',
  node: '9.3.0',
  v8: '6.2.414.46-node.15',
  uv: '1.18.0',
  zlib: '1.2.11',
  ares: '1.13.0',
  modules: '59',
  nghttp2: '1.25.0',
  openssl: '1.0.2n',
  icu: '60.1',
  unicode: '10.0',
  cldr: '32.0',
  tz: '2017c' }

Node Platform: win32
Node architecture: x64
node-sass version:

node-sass       4.7.2   (Wrapper)       [JavaScript]
libsass         3.5.0.beta.2    (Sass Compiler) [C/C++]

npm node-sass versions:

leadstack@0.1.0 C:\Users\PWooSam\P5%20-%20Web%20Front%20End\src\LeadStack
`-- gulp-sass@3.1.0
  `-- node-sass@4.7.2

Input SCSS

@mixin hover {
  // TODO: re-enable along with mq4-hover-shim
//  @if $enable-hover-media-query {
//    // See Media Queries Level 4: https://drafts.csswg.org/mediaqueries/#hover
//    // Currently shimmed by https://github.com/twbs/mq4-hover-shim
//    @media (hover: hover) {
//      &:hover { @content }
//    }
//  }
//  @else {
    &:hover { @content; }
//  }
}


@mixin hover-focus {
  @if $enable-hover-media-query {
    &:focus {
      @content;
    }
    @include hover { @content; }
  } @else {
    &:focus,
    &:hover {
      @content;
    }
  }
}
...

Resulting error

{ uid: 10,
  name: 'writeBundles',
  branch: false,
  error: Error: Invalid mapping: {"generated":{"line":246,"column":3},"source":"styles/bootstrap/mixins/_hover.scss","original":{"line":12,"column":-27},"name":null}
    at SourceMapGenerator_validateMapping [as _validateMapping] (C:\Users\PWooSam\P5%20-%20Web%20Front%20End\src\LeadStack\node_modules\source-map\lib\source-map-generator.js:289:13)
    at SourceMapGenerator_addMapping [as addMapping] (C:\Users\PWooSam\P5%20-%20Web%20Front%20End\src\LeadStack\node_modules\source-map\lib\source-map-generator.js:101:12)
    at C:\Users\PWooSam\P5%20-%20Web%20Front%20End\src\LeadStack\node_modules\aurelia-cli\lib\build\concat-with-sourcemaps\index.js:61:28
    at Array.forEach (<anonymous>)
    at BasicSourceMapConsumer.SourceMapConsumer_eachMapping [as eachMapping] (C:\Users\PWooSam\P5%20-%20Web%20Front%20End\src\LeadStack\node_modules\source-map\lib\source-map-consumer.js:155:14)
    at Concat.add (C:\Users\<Username>\P5%20-%20Web%20Front%20End\src\LeadStack\node_modules\aurelia-cli\lib\build\concat-with-sourcemaps\index.js:59:18)
    at work.then (C:\Users\PWooSam\P5%20-%20Web%20Front%20End\src\LeadStack\node_modules\aurelia-cli\lib\build\bundle.js:215:16)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:160:7),
  duration: [ 1, 939341772 ],
  time: 1513293686334 }
...
@pwoosam
Copy link
Author

pwoosam commented Dec 31, 2017

As of right now, it looks like the only way to get around this error is to either disable source maps for sass files that have these issues with compound selectors.

If you must have source maps, then ruby-sass is an option. The only issue being that you need to install Ruby and the Sass gem for Ruby in order to get it to work.

@sass sass deleted a comment from robogeek Jan 4, 2018
@fkleuver
Copy link

Looks like this is fixed in libsass.

@mrDinckleman
Copy link

A new version of LibSass was released

@modosc
Copy link

modosc commented Feb 12, 2018

i think this is the actual change: sass/libsass@6892bf5

but node-sass is using the 3.5.0-beta branch of node-sass which doesn't seem to be getting backports actively. would a pr that cherrypicked this fix be accepted here?

@jrsinclair
Copy link

Would love to see this one sorted.

@xzyfer
Copy link
Contributor

xzyfer commented Mar 10, 2018

Fixed in 4.8.0

@xzyfer xzyfer closed this as completed Mar 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants