// Include gulp
var gulp = require('gulp');
// Include Our Plugins
var sass = require('gulp-sass');
var browserSync = require('browser-sync');
var reload = browserSync.reload;
var util = require('gulp-util');
var cleanCSS = require('gulp-clean-css');
var rename = require('gulp-rename');
var nunjucks = require('gulp-nunjucks');
var cleanCSS = require('gulp-clean-css');
var csslint = require('gulp-csslint');
var cssLintConfig = {<lint config>}
// lint css
gulp.task('csslint', function() {<some code here>});
// Compile Our css
gulp.task('sass', function() {<some code here>});
// browser-sync
gulp.task('browser-sync', function () {<some code here>});
gulp.task('nunjucks', () =>
gulp.src('pages/base.html')
.pipe(nunjucks.compile().on('error', function(error){
console.log(error);
}))
.pipe(gulp.dest('public'))
.pipe(reload({stream: true}))
);
// Watch Files For Changes
gulp.task('watch', function() {<some code here>});
gulp.task('minify-css', () => {<some code here>});
// Default Task
gulp.task('default', ['nunjucks', 'sass', 'watch', 'browser-sync']);
the error stack:
[07:30:46] Starting 'nunjucks'...
[07:30:47] { TypeError: First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.
at Function.Buffer.from (buffer.js:183:11)
at DestroyableTransform._transform (<root>/node_modules/gulp-nunjucks/index.js:29:27)
at DestroyableTransform.Transform._read (<root>/node_modules/readable-stream/lib/_stream_transform.js:184:10)
at DestroyableTransform.Transform._write (<root>/node_modules/readable-stream/lib/_stream_transform.js:172:83)
at doWrite (<root>/node_modules/readable-stream/lib/_stream_writable.js:428:64)
at writeOrBuffer (<root>/node_modules/readable-stream/lib/_stream_writable.js:417:5)
at DestroyableTransform.Writable.write (<root>/node_modules/readable-stream/lib/_stream_writable.js:334:11)
at write (<root>/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_readable.js:623:24)
at flow (<root>/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_readable.js:632:7)
at DestroyableTransform.pipeOnReadable (<root>/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_readable.js:664:5)
message: 'First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.',
name: 'TypeError',
stack: 'TypeError: First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.\n at Function.Buffer.from (buffer.js:183:11)\n at DestroyableTransform._transform (<root>/node_modules/gulp-nunjucks/index.js:29:27)\n at DestroyableTransform.Transform._read (<root>/node_modules/readable-stream/lib/_stream_transform.js:184:10)\n at DestroyableTransform.Transform._write (<root>/node_modules/readable-stream/lib/_stream_transform.js:172:83)\n at doWrite (<root>/node_modules/readable-stream/lib/_stream_writable.js:428:64)\n at writeOrBuffer (<root>/node_modules/readable-stream/lib/_stream_writable.js:417:5)\n at DestroyableTransform.Writable.write (<root>/node_modules/readable-stream/lib/_stream_writable.js:334:11)\n at write (<root>/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_readable.js:623:24)\n at flow (<root>/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_readable.js:632:7)\n at DestroyableTransform.pipeOnReadable (<root>/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_readable.js:664:5)',
__safety: undefined,
_stack: undefined,
plugin: 'gulp-nunjucks',
showProperties: true,
showStack: false,
fileName: '<root>/pages/base.html' }
it seems to happen when files get too big. Are there any known problems?
I have created a nunjucks vanilla build and it runs fine:
Hey, I have a problem while compiling my project.
Infos: package.json
my gulpfile:
the error stack:
it seems to happen when files get too big. Are there any known problems? I have created a nunjucks vanilla build and it runs fine:
any ideas how to solve the error above? Or is there maybe a misconfig?