Twitter bootstrap 引导式sass+;gulp:媒体查询表达式必须以';(';

Twitter bootstrap 引导式sass+;gulp:媒体查询表达式必须以';(';,twitter-bootstrap,sass,gulp,gulp-sass,Twitter Bootstrap,Sass,Gulp,Gulp Sass,我在这里遇到了bootstrap sass的问题。我正试图通过Gulp和我的style.scss文件中的一些其他scss库编译bootstrap,但它引发了以下错误: Message: css/dev/style.scss Error: media query expression must begin with '(' on line 1 of css/dev/style.scss >> @import 'breakpoint-slicer' ----

我在这里遇到了bootstrap sass的问题。我正试图通过Gulp和我的
style.scss
文件中的一些其他scss库编译bootstrap,但它引发了以下错误:

Message:
    css/dev/style.scss
Error: media query expression must begin with '('
        on line 1 of css/dev/style.scss
>> @import 'breakpoint-slicer'
   ---------------------------^

Details:
    formatted: Error: media query expression must begin with '('
        on line 1 of css/dev/style.scss
>> @import 'breakpoint-slicer'
   ---------------------------^

    column: 28
    line: 1
    file: /home/nano/Sandbox/bolt-seed/theme/own-theme/css/dev/style.scss
    status: 1
    messageFormatted: css/dev/style.scss
Error: media query expression must begin with '('
        on line 1 of css/dev/style.scss
>> @import 'breakpoint-slicer'
   ---------------------------^
messageOriginal: media query expression must begin with '(' relativePath: css/dev/style.scss
我只是在我的根样式文件夹上复制了一个
\u variables.scss
副本(暂时不做任何更改),我得到了错误。如果我在导入中包含
断点切片器
,也是一样的

这是我的吞咽任务和我的
风格。scss

吞咽任务 style.scss:
所有资产都由Bower在
assets
文件夹中管理。对此有什么想法或提示吗?

原因可能有几个。一个是该文件不在您认为它与gulpfile相关的位置。我刚刚在本地重新创建了该问题,除非我有正确的
IncludePath
,否则它无法工作

不正确:(stylesheet.scss)

当我更正它时,导入的文件没有任何问题:

e、 g

您确定gulpfile正确读取了该路径吗

如果url是100%正确的,那么您需要重新访问您的sass文件-其中包括部分-我注意到您没有分号-它们在每次导入结束时都是真正需要的。将它们放进去,那么您的代码应该是正确的

没有分号-任务失败

使用分号-任务构建很好:


如果在
@import“xyz”之后忘记添加分号;,

问题是你的第二个提示:分号。我来自触控笔,这是我的习惯,不使用分号…所以,谢谢!这是非常小的东西,但我看不到它。
gulp.task('sass-build', () => {
  return gulp.src('./css/dev/*.scss')
    .pipe(plumber())
    .pipe(sourcemaps.init())
    .pipe(sass({
      includePaths: [
        './assets/bootstrap-sass/assets',
        './assets/breakpoint-slicer/stylesheets',
      ],
      outputStyle: 'compressed'
    }))
    .pipe(sourcemaps.write('./css'))
    .pipe(gulp.dest('./css'));
});
@import 'breakpoint-slicer'

@import 'variables'
@import 'bootstrap'

body {
  padding: 50px
}
.pipe(sass({
    outputStyle: 'nested',
    includePaths: [
        './bower_components/breakpoint-slicer/stylesheets'
    ]
}))