Tabler: Build failing due to sass include path

Created on 10 Nov 2018  Â·  4Comments  Â·  Source: tabler/tabler

I have just freshly cloned the project, installed npm packages and ruby gems. When I run npm run dist (or anything to do with the SASS) I get the following error:

$ npm run dist

> gulp build && JEKYLL_ENV=production jekyll build --destination dist

[16:16:11] Using gulpfile tabler/gulpfile.js
[16:16:11] Starting 'styles'...
[16:16:11] Starting 'styles-plugins'...
Error in plugin "sass"
Message:
    src/assets/scss/bundle.scss
Error: File to import not found or unreadable: ~bootstrap/scss/bootstrap.scss.
        on line 6 of src/assets/scss/bundle.scss
>> @import '~bootstrap/scss/bootstrap.scss';

If I replace ~bootstrap/scss/bootstrap.scss with node_modules/bootstrap/scss/bootstrap.scss everything works as expected.

I tried to update gulpfile.js with an includePath for the SASS pipeline but no dice. Is this working for others?

        .pipe(sass({
            precision: 8,
            outputStyle: 'expanded',
            includePaths: ['./node_modules/'] . // added to try and resolve ~
        }).on('error', sass.logError))

Most helpful comment

modify file:

src/assets/scss
➜ scss git:(dev) ✗ cat bundle.scss
/**
Dashboard UI
*/

@import 'variables';
@import 'bootstrap/scss/bootstrap.scss';
@import 'dashboard/dashboard';

then

ln -s ../../../node_modules/bootstrap

All 4 comments

modify file:

src/assets/scss
➜ scss git:(dev) ✗ cat bundle.scss
/**
Dashboard UI
*/

@import 'variables';
@import 'bootstrap/scss/bootstrap.scss';
@import 'dashboard/dashboard';

then

ln -s ../../../node_modules/bootstrap

Thanks @bigxu, will conclude their is something wrong with my environment and thus the workaround needed.

If this were broader I'd expect more people to be facing the issue based on a fresh clone.

I have the same problem on a clean "git clone". Many people may be affected by this

modify file:

src/assets/scss
➜ scss git:(dev) ✗ cat bundle.scss
/**
Dashboard UI
*/

@import 'variables';
@import 'bootstrap/scss/bootstrap.scss';
@import 'dashboard/dashboard';

then

ln -s ../../../node_modules/bootstrap

It must be an environment issue.

I just accepted it and updated to @import node_modules/bootstrap/scss/bootstrap.scss

Was this page helpful?
0 / 5 - 0 ratings

Related issues

joshi-chinmay picture joshi-chinmay  Â·  6Comments

jaydeepakbari picture jaydeepakbari  Â·  4Comments

iMohammadd picture iMohammadd  Â·  5Comments

hamada147 picture hamada147  Â·  4Comments

guifelix picture guifelix  Â·  3Comments