blendid icon indicating copy to clipboard operation
blendid copied to clipboard

sass globbing `@import "base/*";` error

Open olets opened this issue 6 years ago • 1 comments

Starting from a fresh Blendid install, I enabled Sass globbing à la https://github.com/vigetlabs/blendid/blob/32bec577e862d92215b69c7ea88f27aff93a6cc5/extras/http2/config/task-config.js.

Then with the file structure

.
└── src
    └── stylesheets
        ├── app.scss
        └──  base
             └── test.scss

I tried to import test.scss into app.scss with a glob pattern:

// app.scss
@import "base/*";

On yarn run blendid I got the following error:

gulp-notify: [Error running Gulp] Error in plugin 'gulp-sass'
Message:
    ../base/index.js
Error:
Invalid CSS after "'":
expected 1 selector or at-rule, was "'use strict';"
        on line 1 of ../base/index.js
        from line 2 of base/*
        from line 1 of ../../src/stylesheets/app.scss
>> 'use strict';

   ^

Details:
    status:
1
    file:
/Users/home/Sites/my-site/node_modules/base/index.js
    line:
1
    column:
1
    formatted:
Error:
Invalid CSS after "'":
expected 1 selector or at-rule, was "'use strict';"
        on line 1 of ../base/index.js
        from line 2 of base/*
        from line 1 of ../../src/stylesheets/app.scss
>> 'use strict';

   ^

    messageFormatted:
../base/index.js
Error:
Invalid CSS after "'":
expected 1 selector or at-rule, was "'use strict';"
        on line 1 of ../base/index.js
        from line 2 of base/*
        from line 1 of ../../src/stylesheets/app.scss
>> 'use strict';

   ^

    messageOriginal:
Invalid CSS after "'":
expected 1 selector or at-rule, was "'use strict';"
    relativePath:
../base/index.js

Was able to fix this by changing the name of the stylesheet subfolder:

.
└── src
    └── stylesheets
        ├── app.scss
        └──  fixed
             └── test.scss
// app.scss
@import "fixed/*";

Maybe an includePaths error or similar?

olets avatar Apr 25 '18 15:04 olets

I also got this when using includePaths and naming a file "base". Is it possible that we can't use the name "base" for files?

adamjhickey avatar Nov 09 '18 06:11 adamjhickey