Содержание
- Stops after «Error in plugin ‘gulp-postcss’ » #42
- Comments
- Footer
- Gulp plumber giving error: «Error in plugin ‘sass-lint’» #486
- Comments
- Unhandled ‘error’ event when assertion fails #48
- Comments
- Footer
- Subsequent tasks fail sometimes #4
- Comments
- Gulp inline css not working #26
- Comments
- Footer
Stops after «Error in plugin ‘gulp-postcss’ » #42
Whenever there is an error, like importing file that does not exist (wrong path), I get this error which stops gulp:
Really annoying causing me to restart my tasks every time css error is made. Am I doing something wrong?
The text was updated successfully, but these errors were encountered:
I’m having a similar problem using gulp-postcss , gulp-plumber , and gulp-watch together — task shown below. When the task encounters a CSS error, the task remains open and the error is logged per the warn error handler passed in, so all is good so far. But the build files aren’t updated with any changes made to the source files, like fixing the error.
gulp-watch does still continue to log that changes were detected in the source files; they just don’t get processed anymore unless I restart the task over again.
Has anyone found a solution/workaround for this yet?
I have the same issue.
I have this problem, but nobody resolved it as I see.
Bad fix:
Will work with gulp-notify https://www.npmjs.com/package/gulp-notify
import notify from ‘gulp-notify’; and
Instead .pipe(plumber()) insert .pipe(plumber(< errorHandler: notify.onError(‘Error: ‘) >))
I don’t know why it works, I found it when I wanted to delete gulp-notify , he has his own problems (with notifications).
Just notice the same. Solutions?
© 2023 GitHub, Inc.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Источник
Gulp plumber giving error: «Error in plugin ‘sass-lint’» #486
I’m trying to add sass-lint onto a current project, and the gulp plumber is giving this error whenever it runs:
The _colors.scss file is from the IBM Design Color Palette, and around line #217 looks like this:
#217 is the 3rd line that reads @if $tone. , to be exact. This function can be seen here: https://github.com/IBM-Design/colors/blob/master/_ibm-colors.scss#L25
Any ideas as to why this error is happening? Any workarounds?
The text was updated successfully, but these errors were encountered:
I may be completely wrong but I seem to remember that the version of gonzales-pe that we’re currently stuck on has issues parsing the % character. It’s fixed in the latest version but unfortunately that brings a few regressions which we can’t justify introducing right now.. If you remove that character it parses fine, but obviously that isn’t exactly a workable solution for you.. 😢
@bgriffith can you remember if that’s the case with the % character still?
Ahh yeah, after some fiddling around, it seems like it’s indeed crashing at the % character. And strangely, it was also crashing whenever there were comments in a specific file, but comments in other files were fine.
I think for now to bypass this issue we can exclude this file from the sass-lint task.
Hmm, I’m also experiencing the problem you described with the comments.
It seems to have something to do with slashes. For example this wil crash
What’s the error you’re seeing with the slashes @thomasmattheussen ? does it still say ‘parsing error’?
If so it would be worth reporting on the gonzales-pe repository as those parse errors are our AST rather than sass-lint. Unfortunately we can’t do much about them at the moment..
Источник
Unhandled ‘error’ event when assertion fails #48
When assertion fails an error appears in command line
Plumber says that error is in gulp-webdriver plugin
Everything seems to be working except the error at the end.
This error appears since version 2.0.1.
Is it a normal behaviour or I am doing something wrong?
I am using webdriverio@4.2.8 and gulp-webdriver@2.0.2
Thanks!
The text was updated successfully, but these errors were encountered:
@albanul your reporter should tell you what happened, doesn’t it?
@christian-bromann yes it does, it tells that some of tests passed and some failed, but then it says that somewhere in code there is an unhandled exception and this is a little bit strange for me.
For example, when I run the same test via gulp-mocha
I get this output:
Without any exceptions.
Same behavior when I run directly via mocha without gulp.
But when I run it via gulp-webdriver I get the same output and the exception message
That looks right to me. The test failed and you see the error at the end of the test. What do you miss here?
I am encountering this issue as well. The un-handled error from the gulp-webdriver plugin stops my gulpscript process, this is preventing me from running my test suite across multiple config files.
After starting the server I’m currently using the following to run the tests:
Am i missing something or is there another way of doing this?
Also getting this issue. @christian-bromann will there be any progress made on this?
© 2023 GitHub, Inc.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Источник
Subsequent tasks fail sometimes #4
I’m experiencing some errors when using gulp-clean:
I’m trying to deleted a directory before running other tasks, but somehow the subsequent tasks do not create the desired directories/files after running gulp-clean. It seems like gulp-clean somehow interferes with the other tasks.
Any idea what that could be?
The text was updated successfully, but these errors were encountered:
I was able to get rid of the error messages, but still — the subsequent tasks do not create files in the directory, which should have been cleaned before. It seems like the cleaning happens after the new files got created.
If I configure the task to only delete the files inside the directories, all works well. But if I configure to delete the parent directory, new files won’t get created correctly.
I cloned your repository and it seems like there is an issue with if plugin.
Does it work if you change:
and run it with gulp build
Of course this is not a great solution, but it helps to track down the problem.
@peter-vilja thanks for your fast reply. You’re right — seems to be related to the gulp-if plugin. Do you think it’s related to robrich/gulp-if#12?
@thasmo No problem. Kind of. I am not sure, maybe the issue might be that gulp-if registers a child listener even when the file passed to stream gulp.src(‘public/static/’. ) doesn’t exist.
Or maybe it’s not issue with gulp-if, because this seems to cause the same problem.
And it seems to work.
@thasmo Now it seems like the issue is with gulp-load-plugins because this seems to work:
@thasmo I think it’s because the gulp-load-plugins emit’s ‘end’ before gulp-clean. Now the dependency system thinks that task is done, but only the gulp-load-plugins is done and the clean finishes later asynchronously.
@peter-vilja, this again fails sometimes:
If there’re already files in the directory public/static/ , it gets removed,
but stays empty (no files are generated). If I again execute gulp build —production
the directory gets populated correctly.
@thasmo Same thing here the if plugin ’emit’s end before clean plugin and the clean is run asynchronously later.
Use this one:
So, are those bugs in if and load-plugins ?
@thasmo No. Just the dependency system believes that the task ‘clean’ is done because ‘end’ was emitted inside the task. But this ‘end’ wasn’t gulp-clean’s ‘end’ emit it was other plugins (‘end’) finishing first before gulp-clean. After this the dependency system started to run tasks ‘scripts’, ‘styles’ and ‘images’ and the actual process of clean finishes some where after running the other tasks.
@peter-vilja, I see. Which would be weird for the if plugin at least, because it makes it useless, no?
@thasmo Well only inside the task which is as a dependency to other task and last pipe is using it I think.
For example here it would not be useless:
I think this should work because now the last pipe .pipe(gulp.dest(‘dist’)); Will emit correctly that the stream ended.
Or maybe this could be fixed in gulp-if by emitting ‘end’ only after the child process emit’s end. I am not 100% sure that this is the issue, but it seems to be.
Источник
Gulp inline css not working #26
I have an issue with gulp-inline-css and I can’t figure what is wrong.
The error is as below
I tried to modify tasks/build.js to specify the url of the stylesheets as below:
But it still doesn’t work.
Any idea? Thanks a lot in advance
The text was updated successfully, but these errors were encountered:
Hi there, you shouldn’t have to modify the build.
What node version are you running?
Also, can you run tree templates in the root of the project?
Thanks for your quick answer, here is my tree templates result:
Files are untouched
C:USERSPAULDEVSIGNATURETEMPLATES
and I’m running node v6.9.4
Let me know if you need some other info!
Just took a quick look at previous commits and saw src was renamed to templates. Could it be related?
It had something to do with the newer version of node returning inconsistent paths for Windows / Unix. I myself am not a Windows user, so I wasn’t aware that upgrading node affected this, sorry for that 🙂
Pull the code @ 12bffe8 and give it a go. LMK if there are any other problems, I tested on Win 7/8.
Thank you for this quick fix, it is working perfectly indeed!
© 2023 GitHub, Inc.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Источник
Normally Gulp-Sass compiles Sass to CSS perfectly until there is an error in a Sass file(for eg: h1{font-size:}).
I have used Gulp Plumber to prevent the pipes from breaking but I could not figure out the way to properly use it. In the above example, even if I fix the error and make it h1{font-size:32px;}, CSS is not generated.
ERROR
Plumber found unhandled error:
error in plugin 'gulp-sass'
Message:
appscsspages_landing.scss
Error: style declaration must contain a value
...
gulpfile
// Requires Gulp
var gulp = require('gulp');
// Require Gulp Sass
var sass = require('gulp-sass');
// Require Browser Sync
var browserSync = require('browser-sync').create();
// For minificatin
var useref = require('gulp-useref');
var uglify = require('gulp-uglify');
var gulpIf = require('gulp-if');
var cssnano = require('gulp-cssnano');
// Require imagemin
var imagemin = require('gulp-imagemin');
var cache = require('gulp-cache');
// Require del
var del = require('del');
// Require runsequence
var runSequence = require('run-sequence');
// Require Sourcemaps
var sourcemaps = require('gulp-sourcemaps');
// Require Plumber
var plumber = require('gulp-plumber');
// Prepocessing Sass
gulp.task('sass', function(){
return gulp.src('app/scss/**/*.scss')
.pipe(sourcemaps.init())
.pipe(plumber({
handleError: function (err) {
console.log(err);
this.emit('end');
}
}))
.pipe(sass()) // Using gulp-sass
.pipe(sourcemaps.write())
.pipe(gulp.dest('app/css'))
.pipe(browserSync.reload({
stream: true
}))
});
// Spinning up a Browser Sync Server
gulp.task('browserSync', function() {
browserSync.init({
server: {
baseDir: 'app'
},
})
})
// Watching for changes
gulp.task('watch', ['sass', 'browserSync'], function(){
gulp.watch('app/scss/**/*.scss', ['sass']);
gulp.watch('app/*.html', browserSync.reload);
})
// Gulp Default Function
gulp.task('default', function (callback) {
runSequence(['sass','browserSync', 'watch'],
callback
)
})
// Minification
gulp.task('useref', function(){
return gulp.src('app/*.html')
.pipe(useref())
// Minifies only if it's a JavaScript file
.pipe(gulpIf('*.js', uglify()))
// Minifies only if it's a CSS file
.pipe(gulpIf('*.css', cssnano()))
.pipe(gulp.dest('dist'))
});
// Image Optimization
gulp.task('images', function(){
return gulp.src('app/images/**/*.+(png|jpg|jpeg|gif|svg|JPG)')
// Caching images that ran through imagemin
.pipe(cache(imagemin({
interlaced: true
})))
.pipe(gulp.dest('dist/images'))
});
// Copy Fonts
gulp.task('fonts', function() {
return gulp.src('app/fonts/**/*')
.pipe(gulp.dest('dist/fonts'))
})
// Cleaning up generated files
gulp.task('clean:dist', function() {
return del.sync('dist');
})
// Build Production website
gulp.task('build', function(callback) {
runSequence(
'clean:dist',
'sass',
['useref', 'images', 'fonts'],
callback
)
})
Здравствуйте, Александр! Проблема в следующем. Настроила по вашему уроку сборку проекта с помощью gulp, целый день все отлично работало (огромное спасибо вам за уроки
!!). Но в какой-то момент при запуске задачи css:build gulp-plumber начал выдавать ошибку в плагине gulp-sass, ссылаясь при этом на ошибки в исходных файлах бутстрапа, которые я, естественно, не правила:
Message:
node_modulesbootstrapscss_tables.scss
Error: Function theme-color-level finished without @return
on line 101 of node_modules/bootstrap/scss/_tables.scss, in function `theme-color-level`
from line 101 of node_modules/bootstrap/scss/_tables.scss
from line 14 of assets/src/style/main.scss
>> @include table-row-variant($color, theme-color-level($color, $table-bg-lev
-------------------------------------^
Details:
status: 1
file: C:/Obr/node_modules/bootstrap/scss/_tables.scss
line: 101
column: 38
formatted: Error: Function theme-color-level finished without @return
on line 101 of node_modules/bootstrap/scss/_tables.scss, in function `theme-color-level`
from line 101 of node_modules/bootstrap/scss/_tables.scss
from line 14 of assets/src/style/main.scss
>> @include table-row-variant($color, theme-color-level($color, $table-bg-lev
-------------------------------------^
messageFormatted: node_modulesbootstrapscss_tables.scss
Error: Function theme-color-level finished without @return
on line 101 of node_modules/bootstrap/scss/_tables.scss, in function `theme-color-level`
from line 101 of node_modules/bootstrap/scss/_tables.scss
from line 14 of assets/src/style/main.scss
>> @include table-row-variant($color, theme-color-level($color, $table-bg-lev
-------------------------------------^
messageOriginal: Function theme-color-level finished without @return
relativePath: node_modulesbootstrapscss_tables.scss
Подскажите, что могло произойти и как теперь восстановить статус-кво? Заранее приношу извинения за тупизм, я гуманитарий-самоучка, базовых знаний катастрофически не хватает(((