2

При подключении в проект версии bootstrap на SASS - ломается сборка из-за ошибок при генерации sourcemap. Как это можно исправить?

Сообщение об ошибках

C:\Users\user\Desktop\Проекты_fe\_fe-template_для-портфолио\node_modules\source-map\lib\source-map-generator.js:277
      throw new Error('Invalid mapping: ' + JSON.stringify({
      ^

Error: Invalid mapping: {"generated":{"line":432,"column":10},"source":"bs-grid/bootstrap/mixins/_clearfix.scss","original":{"line":14,"column":-1},"name":null}
    at SourceMapGenerator_validateMapping [as _validateMapping] (C:\Users\user\Desktop\Проекты_fe\_fe-template_для-портфолио\node_modules\source-map\lib\source-map-generator.js:277:13)
    at SourceMapGenerator_addMapping [as addMapping] (C:\Users\user\Desktop\Проекты_fe\_fe-template_для-портфолио\node_modules\source-map\lib\source-map-generator.js:101:12)
    at C:\Users\user\Desktop\Проекты_fe\_fe-template_для-портфолио\node_modules\concat-with-sourcemaps\index.js:60:28
    at Array.forEach (native)
    at BasicSourceMapConsumer.SourceMapConsumer_eachMapping [as eachMapping] (C:\Users\user\Desktop\Проекты_fe\_fe-template_для-портфолио\node_modules\source-map\lib\source-map-consumer.js:155:14)
    at Concat.add (C:\Users\user\Desktop\Проекты_fe\_fe-template_для-портфолио\node_modules\concat-with-sourcemaps\index.js:58:18)
    at DestroyableTransform.bufferContents [as _transform] (C:\Users\user\Desktop\Проекты_fe\_fe-template_для-портфолио\node_modules\gulp-concat\index.js:68:12)
    at DestroyableTransform.Transform._read (C:\Users\user\Desktop\Проекты_fe\_fe-template_для-портфолио\node_modules\readable-stream\lib\_stream_transform.js:182:10)
    at DestroyableTransform.Transform._write (C:\Users\user\Desktop\Проекты_fe\_fe-template_для-портфолио\node_modules\readable-stream\lib\_stream_transform.js:170:83)
    at doWrite (C:\Users\user\Desktop\Проекты_fe\_fe-template_для-портфолио\node_modules\readable-stream\lib\_stream_writable.js:405:64)

Содержимое файла, упоминаемого в сообщении об ошибке

// Clearfix
//
// For modern browsers
// 1. The space content is one way to avoid an Opera bug when the
//    contenteditable attribute is included anywhere else in the document.
//    Otherwise it causes space to appear at the top and bottom of elements
//    that are clearfixed.
// 2. The use of `table` rather than `block` is only necessary if using
//    `:before` to contain the top-margins of child elements.
//
// Source: http://nicolasgallagher.com/micro-clearfix-hack/

@mixin clearfix() {
  &:before,
  &:after {
    content: " "; // 1
    display: table; // 2
  }
  &:after {
    clear: both;
  }
}

1 ответ 1

1

Проблема на уровен самого SASS. (Нет поддержки амперсанда для примесей в некоторых ситуациях).

Варианты решений тут: Source-map error with bootstrap-sass ampersand · Issue #429 · nodejs/help

Ваш ответ

Нажимая на кнопку «Отправить ответ», вы соглашаетесь с нашими условиями использования и подтверждаете, что прочитали и поняли наши политику конфиденциальности и нормы поведения.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.