-
-
Notifications
You must be signed in to change notification settings - Fork 45
1.0.0 is throwing errors #2
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
Comments
Autoprefixer have changed its API, know you need yo pass the browsers like this: .pipe(autoprefixer({browsers: ['last 2 versions']})) If you want, you can still use the v0.0.10. |
Sadly that doesn't solve the problem, I still get the same error about "applySourceMap requires either an explicit source file, or the source map's "file" property". |
Can you try removing the less plugin and see if that changes anything? |
Eh not really as I don't have valid css files, only Less files, sorry. |
Ah wait I'll use a parsed version, d'oh :) Probably won't have time until tomorrow though. |
You also need to use the new method signature. See the readme. |
With previous version there was no problem. But now when using this
But with pure css gulp-autoprefixer doing his job and also sourcemaps
Also withoud gulp-autoprefixer task, gulp-less is doing his job
|
Came here to voice my concern as well on this issue as I'm getting the same/a similar error message. It seems in my case is caused by autoprefixer Gulp task gulp.task('styles_compile', ['vendor_css', 'vendor_fonts'], function () {
return gulp.src('src/styles/site.less')
.pipe(sourcemaps.init())
.pipe(less())
.pipe(autoprefixer())
.pipe(sourcemaps.write())
.pipe(gulp.dest('public/assets/css'));
}); Stack trace
|
Can you try putting Line 35 in 3c8354f
|
Console output:
|
Looks like gulp-ng-annotate was having the same issue. Here's their workaround: Kagami/gulp-ng-annotate@2dd427d That probalby won't work in this case, since the file.sourceMap.file property is already gone once it gets to gulp-autoprefixer. It could be an issue with vinyl-sourcemap-apply or it could be gulp-less not handling the gulp source map pipeline correctly? |
Thanks @dfaivre. I've opened a ticket here: gulp-sourcemaps/vinyl-sourcemaps-apply#1 |
this is happening to me as well:
getting
|
@sindresorhus , the author of vinyl-sourcemap just said its not a bug on his end. |
As a stopgap, I ended up created a custom gulp-autoprefixer that resets the file property before it tries to apply source maps: res = autoprefixer(fileOpts).process(file.contents.toString(), {
map: file.sourceMap ? {prev: file.sourceMap} : false,
from: file.relative,
to: file.relative
});
file.contents = new Buffer(res.css);
if (res.map && file.sourceMap) {
if (!(file.sourceMap.file)) {
file.sourceMap.file = file.relative;
}
applySourceMap(file, res.map.toString());
} Is this really an issue with gulp-less not setting the file.sourceMap.file property? Should all plugins have to guard against this? |
@dfaivre It's an gulp-less issue and will be fixed as soon as gulp-community/gulp-less#85 is merged. |
@sindresorhus I just updated gulp-less to the one with gulp-community/gulp-less#85 and is now version 1.3.6. It works but it throws a warning: If I remove gulp-autoprofexier plugin it works. My current gulpfile.js
|
@deezahyn Does this work for you, too? #3 |
var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
gulp.task('styles', function () {
return gulp.src(src/'styles/bootstrap.less')
.pipe($.sourcemaps.init())
.pipe($.less())
.pipe($.autoprefixer())
.pipe($.sourcemaps.write());
.pipe(gulp.dest('./build/css'));
}); $ gulp styles
[11:13:47] Using gulpfile gulpfile.js
[11:13:47] Starting 'styles'...
gulp-sourcemap-write: source file not found: src\styles\bootstrap.css
[11:13:49] Finished 'styles' after 1.97 s gulp-autoprefixer 1.0.1, gulp-less 1.3.6, gulp-sourcemaps 1.2.2, OS: Windows |
@codekirei |
- Current build seems to fail. It might have something to do with the default option Default: ['> 1%', 'last 2 versions', 'Firefox ESR', 'Opera 12.1'] which may change over time. - this commit updates the sourcemap file generated.
Same error with gulp-autoprefixer 1.0.1 Does anyone else have this issue? Or, maybe, it only takes place on Windows machines? If I comment out gulp-sourcemaps/gulp-sourcemaps#37 (comment)
|
We have this issue too, and #3 seems to fix it for us. |
It seems troubles caused by vinyl-sourcemaps-apply module. With this fix it just works.
This is my gulp task:
This worked fine with gulp-autoprefixer 0.0.10. After upgrading to 1.0.0 I am getting this error:
The text was updated successfully, but these errors were encountered: