gulp-sass: IncludePath not working in current version

Hi Team, Reason : It’s works with old node-sass 4.7.2, but it doesn’t work in node-sass 4.8.1 latest version. Can you please provide the solution for this issue. It throws error.

Error: File to import not found or unreadable: ‘…’

Note: It’s works with node-sass 4.7.2 version

var sass = require('gulp-sass'); pipe(sass({ outputStyle: 'expanded', **includePaths: path** })

Thanks, Jayaprakash K.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 17

Most upvoted comments

~ imports are a webpack feature and are not part of the Sass language.

On Thu., 9 May 2019, 8:12 am Alex Barker, notifications@github.com wrote:

@import “~bootstrap/scss/functions”; should be @import “bootstrap/scss/functions”; as the ~ does not appear to resolve to node_modules using gulp.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dlmanning/gulp-sass/issues/668#issuecomment-490669839, or mute the thread https://github.com/notifications/unsubscribe-auth/AAENSWD3KVJUFYSFPNUFDXDPUNF5XANCNFSM4EUZPYPQ .

@xzyfer I’ve tried using the path module get around using ./ or ../ but still no success. I’ve tried multiple different ways, a couple of which being this:

includePaths: [
    path.join(__dirname, 'node_modules')
]

and

includePaths: [
    'node_modules'
]

in my SCSS file I’m compiling, I have @import '@material/toolbar'; though I keep getting the error Error: File to import not found or unreadable: @material/toolbar.