Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

'An importer must have either canonicalize and load methods, or a findFileUrl method' after migrating to 6 #873

Open
roniemartinez opened this issue Nov 28, 2024 · 2 comments

Comments

@roniemartinez
Copy link

We are trying to upgrade from 5.1.0 to 6.0.0 and following the guide from https://github.com/dlmanning/gulp-sass?tab=readme-ov-file#migrating-to-version-6

However, it seems an importer that we are using (node-sass-tilde-importer) is not compatible with this version.

// gulpfile.mjs

import * as dartSass from 'sass';
import gulpSass from 'gulp-sass';
import tildeImporter from "node-sass-tilde-importer";

const sass = gulpSass(dartSass);

// ...

gulp.task('app_sass', function () {
    return gulp.src(dir.app_scss + '*.scss')
        // ...
        .pipe(sass({importer: tildeImporter, style: 'compressed'}).on('error', sass.logError))
        // ...
});

Error:

Error in plugin "sass"
Message:
    static/app/scss/app.min.scss
An importer must have either canonicalize and load methods, or a findFileUrl method.

Are there any guides for this? Thanks

@xzyfer
Copy link
Collaborator

xzyfer commented Nov 28, 2024 via email

@nitesh-voya
Copy link

I am also getting the same issue after I migrated gulp-sass to 6.0.0 version.
I am using node-sass-import-once

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants