Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

gulp-notify: [Error running notifier] Could not send message: error is not defined when try to import styles from other directory #141

Open
KonstantinShirmanov opened this issue Jan 19, 2022 · 0 comments

Comments

@KonstantinShirmanov
Copy link

KonstantinShirmanov commented Jan 19, 2022

I have this gulp task for convert scss to css files.

import dartSass from "sass"
import gulpSass from "gulp-sass"
import groupCssMediaQueries from "gulp-group-css-media-queries"
import autoPrefixer from "gulp-autoprefixer"
import webpcss from "gulp-webpcss"
import GulpCleanCss from "gulp-clean-css"


const sass = gulpSass(dartSass);

export const scss = () => {
	return app.gulp.src(app.path.src.css, { sourcemaps: true })
	.pipe(app.plugins.plumber(
		app.plugins.notify.onError({
			title: "SCSS",
			message: "Error : <%= error.message %>" 
		})
	))	
	.pipe(app.plugins.cached("css"))
		.pipe(app.plugins.newer(app.path.build.css))
		.pipe(app.plugins.replace(/@img\//g, "../img/"))

		.pipe(sass({
			outputStyle: "expanded"
		}))

		.pipe(
			groupCssMediaQueries()
		)
		.pipe(
			autoPrefixer({
				overrideBrowserslist: ["last 5 version"],
				cascade: true,
				grid: true
			})
		)
		.pipe(app.plugins.remember("scss"))
		.pipe(webpcss({
			webpClass: ".webp",
			noWebpClass: ".no-webp"
		}))
		.pipe(app.gulp.dest(app.path.build.css))
		.pipe(GulpCleanCss())
		.pipe(
			app.plugins.rename({
				extname: ".min.css"
			})
		)
		.pipe(app.gulp.dest(app.path.build.css))
		.pipe(app.plugins.browsersync.stream())
}

app here is a global object for all tasks, were all pathes and common plugins are imported. I also heve a main.scss file and some other files, My scss task works fine when I import in main.scss the files, which are in the same directory as main.scss, like this:

@import "./fonts.scss";
But when I try to import in main.scss the file, which is in other directory like this:
@import "./base/mixins.scss";
Gulp throws an error in console:

gulp-notify: [Error running notifier] Could not send message: error is not defined

Also the weird is I have a plumber in my task, but the error throws only in console.

P.S. I could attach all my files including the gulpfile if you need it. And sorry for my poor English.

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

No branches or pull requests

1 participant