Skip to content
This repository has been archived by the owner on Sep 15, 2023. It is now read-only.

sass globbing @import "base/*"; error #554

Open
olets opened this issue Apr 25, 2018 · 1 comment
Open

sass globbing @import "base/*"; error #554

olets opened this issue Apr 25, 2018 · 1 comment

Comments

@olets
Copy link
Contributor

olets commented Apr 25, 2018

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?

@adamjhickey
Copy link

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?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants