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

BOM triggers invalid CSS exception #1619

Closed
roydukkey opened this issue Jul 1, 2016 · 6 comments
Closed

BOM triggers invalid CSS exception #1619

roydukkey opened this issue Jul 1, 2016 · 6 comments

Comments

@roydukkey
Copy link

Using gulp-sass in the following way is causing an error with single line comments in imports:

gulp.task('build:sass', function () {
    return gulp.src('./wwwroot/theme/**/*.sass', { base: './' })
        .pipe(sass({
            precision: 6,
            sourceMap: true,
            includePaths: [
                './wwwroot/css',
                './wwwroot/lib'
            ]
        }).on('error', sass.logError))
        .pipe(gulp.dest('./'));
});

test.sass

@import config

// =================================================== //
// EDIT THIS FILE                                      //
// =================================================== //

$background: red

body
    background: $background

_config.sass

// =================================================== //
// DO NOT EDIT THIS FILE                               //
// =================================================== //

$background: black

Log

[16:23:02] Using gulpfile C:\Projects\ReadySet\Gulpfile.js
[16:23:02] Starting 'build:sass'...
Error in plugin 'sass'
Message:
    wwwroot\theme\_themeTemplate\css\_config.sass
Error: Invalid CSS after "": expected 1 selector or at-rule, was "{}// =============="
        on line 1 of wwwroot/theme/_themeTemplate/css/_config.sass
[16:23:02] Finished 'build:sass' after 42 ms
>>  {}// =================================================== //
   ^
Process terminated with code 0.
@xzyfer
Copy link
Contributor

xzyfer commented Jul 6, 2016

I am unable to reproduce this with the latest node-sass. Please make sure you're running at least node-sass@3.8.0. You can use the following command to make sure you're up to date.

npm outdated

@xzyfer xzyfer closed this as completed Jul 6, 2016
@roydukkey
Copy link
Author

@xzyfer Awe... I see the issue is the BOM. Shouldn't node-sass account for the possible BOM?

I'm using the latest version.

@roydukkey roydukkey changed the title Singleline comment in import error BOM triggers invalid CSS exception Jul 6, 2016
@xzyfer xzyfer reopened this Jul 6, 2016
@xzyfer
Copy link
Contributor

xzyfer commented Jul 6, 2016

Shouldn't node-sass account for the possible BOM

Yes. Can you confirm if this issue is present when using the SCSS syntax?

@roydukkey
Copy link
Author

No. The issue isn't present in the SCSS syntax.

@xzyfer
Copy link
Contributor

xzyfer commented Jul 7, 2016

Thanks @roydukkey this suggest the issue is in the sass2scss library used inside of LibSass /cc @mgreter

@saper
Copy link
Member

saper commented Oct 18, 2019

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

4 participants