Answer the question
In order to leave comments, you need to log in
Gulp sourcemaps Path must be a string error. How to treat?
Gulp crashes when including sourcemaps. I have already tried everything: I reinstalled the packages, and tried to update the node package 'source-map'
. Nothing helped, I decided to ask here. Has anyone come across something similar? How to cure it?
Here gulpfile.js
:
'use strict';
const gulp = require('gulp');
const stylus = require('gulp-stylus');
const sourcemaps = require('gulp-sourcemaps');
const del = require('del');
const isDevelopment = !process.env.NODE_ENV || process.env.NODE_ENV == 'development';
gulp.task('styles', function() {
return gulp.src('frontend/styles/main.styl')
.pipe( sourcemaps.init())
.pipe(stylus())
.pipe(sourcemaps.write())
.pipe(gulp.dest('public'));
});
gulp.task('clean', function() {
return del('public');
});
gulp.task('assets', function() {
return gulp.src('frontend/assets/**')
.pipe(gulp.dest('public'));
});
gulp.task('build', gulp.series(
'clean',
gulp.parallel('styles', 'assets'))
);
test:$> gulp build
> [email protected] gulp /Users/alex/projects/test
> gulp "build"
[18:34:27] Using gulpfile ~/projects/test/gulpfile.js
[18:34:27] Starting 'build'...
[18:34:27] Starting 'clean'...
[18:34:27] Finished 'clean' after 10 ms
[18:34:27] Starting 'styles'...
[18:34:27] Starting 'assets'...
[18:34:27] 'styles' errored after 185 ms
[18:34:27] TypeError in plugin 'gulp-stylus'
Message:
/Users/alex/projects/test/frontend/styles/main.styl:8:1
4| margin 0
5| padding 0
6| width 100%
7| height 100%
8|
------^
Path must be a string. Received undefined
Details:
domainEmitter: [object Object]
domain: [object Object]
domainThrown: false
[18:34:27] 'build' errored after 200 ms
[18:34:27] The following tasks did not complete: assets
node v6.2.1
npm v3.9.3
test:$> npm view gulp-sourcemaps version
1.6.0
test:$> npm view source-map version
0.5.6
test:$> npm view gulp-stylus version
2.4.0
test:$> npm view stylus version
0.54.5
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question