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-sourcemap-write: source file not found: /absolutePathToProject/scripts/? #37
Comments
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-sourcemaps 1.2.2, gulp-less 1.3.6, gulp-autoprefixer 1.0.1, OS: Windows |
That error message means that:
Both are probably issues of either |
The files do not exist. It's not an error... |
This is happening to me as well, but for files that are definitely there: gulp.src('./src/script.js')
.pipe(sourcemaps.init())
.pipe(uglify())
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest('./dest')); The following is logged:
Strangely, if I add in an additional plugin to concat the file (which, since it's just one file should theoretically do nothing) everything works as expected: gulp.src('./src/script.js')
.pipe(sourcemaps.init())
.pipe(concat('script.js'))
.pipe(uglify())
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest('./dest')); I'm running version |
I'm also having an issue. I have an array with files it needs to uglify and concat. These files are in 2 different directories. One is a bower directory and another is a theme/js directory. It looks like the sourcemaps plugin is messing up the locations. This is the error that I get: Well, the global is the one inside the theme folder. Not the bower folder as you can see in the array: So it does not keep track of the directory the files are in. The concatting and uglifying itself works like a charm. It's the sourcemapping that goes wrong. |
@philipwalton the "?" seems to be coming from gulp-uglify, which does not pass on the source list correctly when it is the first plugin |
Sorry. Here you go:
And the packages:
|
@JohnHeroHD: You get this error because one of the plugins looses the source content. |
Thanks for the quick response. I do not completely understand it. But most importantly, how can I solve this? |
I managed to fix it by updated all the dependencies to their latest versions. My new file looks like this now:
Hope this might help someone else. |
For example, the |
@koistya Why would changing the file name prevent |
gulp.task('styles', function () {
return gulp.src('styles/style.less')
.pipe($.sourcemaps.init())
.pipe($.less())
.pipe($.autoprefixer())
.pipe($.sourcemaps.write())
.pipe(gulp.dest('build/css'));
}); Here is what it prints to the console: [20:39:45] Starting 'styles'...
gulp-sourcemap-write: source file not found:C:\Projects\demo\styles\style.css
[20:39:49] Finished 'styles' after 4.02 s |
@koistya one of the plugins in your chain seems to put a wrong source file reference into the source map (style.css) |
There is just |
This is happening to me when a file loaded from a web resource is present, in my case icomoon: |
@koistya I can confirm that this happens on my machine as well with Unfortunaltely no progress has been made so far, it sure would be awesome if this got fixed, @floridoo would you mind looking into this some more? Pretty please? 😄 |
I believe the issue causing the "source file not found" error is usually in one of the plugins that precede I don't think this has anything to do with the |
I had the same problem, the following fix in the UglifyJS2 package solved my problem: https://github.com/mishoo/UglifyJS2/pull/577/files |
Hi,
this is happening to me whenever a glob doesn't match any file.
I do have some file paths that are configured in general, for cases where there might be a file in a certain directory.
Is this a bug? Can it be silenced (without doing it to all logging)?
The text was updated successfully, but these errors were encountered: