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

JS API does not expose warnings/errors - tooling can't make use of these/display them #2753

Closed
cnweibo opened this issue Dec 5, 2015 · 10 comments

Comments

@cnweibo
Copy link

cnweibo commented Dec 5, 2015

Hi, I have posted a thread in stackoverflow about gulp-less. I want to know how to deliver error information when an error happens during extend a non-existing mixing/class.
http://stackoverflow.com/questions/34107876/is-there-any-way-to-let-gulp-less-print-error-in-case-extend-a-non-existing-mixi

Can you have a look and give me clue. Following is copied from stackoverflow:

In my less build process, i use the gulp-less. In the build process, i use gulp-plumber to print out error information during that build. It works well for the less syntax error, reference to non-exist variables. Unfortunately, the gulp-less build task print out nothing in case we extend a non-existing mixin/class. Does anyone know about how to enable such kind of "error" or even warning during the build? Following is the gulpfile:

gulp.task('less',function(){
var pagelessentry = config.pagelessentry;
log(pagelessentry);
return gulp
.src(pagelessentry)
.pipe(plumber({
errorhandler: errorhandler
}))
.pipe(debug({
title: 'LESS'
}))
.pipe(sourcemaps.init())
.pipe(less())
.pipe(uncss({
html: ['index.html', 'http://homestead.app'],
ignore: [/header-down/,/header-up/]
}))
.pipe(sourcemaps.write(projectrootdir+'public/preparebuild/assets/css/',{includeContent: true}))
.pipe(gulp.dest(projectrootdir+'public/preparebuild/assets/css/'));
});

Following is the "wrong" less code where i want gulp to print out some "error or warning" information:

.footer{
background-color: @primary-background;
&:extend(.NONEXISTING all);
}

In above code, when we extend .NOEXISTING mixin, nothing printed out.
It is quite annoying thing.
Please help me out
Thanks~!

@SomMeri
Copy link
Member

SomMeri commented Dec 5, 2015

Please use backtics for format your code, it will be easier to read and github wont sent email to whoever has the same username as your variables. I added backticks to your comment.

I do not use gulp-less, but you might have more luck to ask question/feature request in gulp-less repository.

I am closing the issue since it is neither bug or feature request (it is possible to continue discussion and answer questions in closed issues too).

@SomMeri SomMeri closed this as completed Dec 5, 2015
@cnweibo
Copy link
Author

cnweibo commented Dec 6, 2015

@SomMeri ,
Thanks for your reply.
I have asked gulp-less guys, they are not sure whether or not it is a less issue itself.
Can you confirm whether or not it is a less bug, otherwise , anything missing in the configuration will cause that "bug"?
Thanks~!

@cnweibo
Copy link
Author

cnweibo commented Dec 6, 2015

@SomMeri ,
I have asked gulp-less guys, they said it should be the less compiler's issue.
"
This seems like an issue where less is not reporting errors back via the JS API. You should open an issue with less so they can add this in.
"
Please refer to:
gulp-community/gulp-less#206 (comment)

Can you re-open this or refer it to other issue for tracking this??

Thanks~!

@yocontra
Copy link

yocontra commented Dec 6, 2015

Yes, this is a less issue - warnings are unavailable when using the JS API directly so tooling can't make use of these/display them.

@SomMeri SomMeri reopened this Dec 6, 2015
@SomMeri SomMeri changed the title gulp-less print out nothing error in case extend a non-existing mixin JS API does not expose warnings/errors - tooling can't make use of these/display them Dec 6, 2015
@SomMeri
Copy link
Member

SomMeri commented Dec 6, 2015

I changed title from "gulp-less print out nothing error in case extend a non-existing mixin" to "JS API does not expose warnings/errors - tooling can't make use of these/display them" so it is immediately clear from issues list what the issue is about.

@seven-phases-max
Copy link
Member

"JS API does not expose warnings/errors - tooling can't make use of these/display them"

This is untrue. Demo - it's JS, it's API, it's exposed (it's a bit akward to use, at least to my personal taste, but it is there).

@SomMeri
Copy link
Member

SomMeri commented Dec 8, 2015

@contra Is the API shown in previous comment good for you and we can close this issue? Is it missing something you need (what)?

@yocontra
Copy link

yocontra commented Dec 8, 2015

@SomMeri Yeah that looks fine, we need to get accord to add it now

@matthew-dean
Copy link
Member

it's a bit akward to use, at least to my personal taste, but it is there

This is tangential to this thread, but: shall we start a less-api repo? Not to document what is (although in part), but to maybe have a goal for what to design towards?

@SomMeri
Copy link
Member

SomMeri commented Dec 9, 2015

@matthew-dean You mean something like unified example about how the api should be used?

@SomMeri SomMeri closed this as completed Dec 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants
@matthew-dean @yocontra @SomMeri @seven-phases-max @cnweibo and others