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

TypeError: Cannot read property 'reduce' of undefined #13

Open
JamesLMilner opened this issue Aug 10, 2017 · 2 comments
Open

TypeError: Cannot read property 'reduce' of undefined #13

JamesLMilner opened this issue Aug 10, 2017 · 2 comments

Comments

@JamesLMilner
Copy link

Hey, thanks for the library.

I'm having issues using gulp-flatten. I am using

  return gulp.src('./components/**/*.pug')
        // .pipe(print())
        .pipe(flatten())
        .pipe(pug({ verbose : false }))
        .pipe(gulp.dest("./../public/templates/"))

also tried

  return gulp.src('./components/**/*.pug')
        // .pipe(print())
        .pipe(pug({ verbose : false }))
        .pipe(flatten())
        .pipe(gulp.dest("./../public/templates/"))

Both produce the following error:

 TypeError: Cannot read property 'reduce' of undefined
    at _flatten (/home/james/Code/3drepo.io/frontend/node_modules/flatten/index.js:14:16)
    at flatten (/home/james/Code/3drepo.io/frontend/node_modules/flatten/index.js:11:10)
    at Gulp.<anonymous> (/home/james/Code/3drepo.io/frontend/gulpfile.js:56:15)
    at module.exports (/home/james/Code/3drepo.io/frontend/node_modules/orchestrator/lib/runTask.js:34:7)
    at Gulp.Orchestrator._runTask (/home/james/Code/3drepo.io/frontend/node_modules/orchestrator/index.js:273:3)
    at Gulp.Orchestrator._runStep (/home/james/Code/3drepo.io/frontend/node_modules/orchestrator/index.js:214:10)
    at Gulp.Orchestrator.start (/home/james/Code/3drepo.io/frontend/node_modules/orchestrator/index.js:134:8)
    at /usr/local/lib/node_modules/gulp/bin/gulp.js:129:20
    at _combinedTickCallback (internal/process/next_tick.js:73:7)
    at process._tickCallback (internal/process/next_tick.js:104:9)

Using:
Node.js LTS 6.11.2
Gulp 3.9.1

@armed
Copy link
Owner

armed commented Aug 12, 2017

Hey, @JamesMilnerUK

Sorry for late reply. Could you try following:

gulp.src('./components/**/*.pug')
        .pipe(flatten())
        .pipe(gulp.dest("./../public/templates/"))

Does it work?

@TheDancingCode
Copy link
Contributor

I believe you tried using the flatten package, and not gulp-flatten.

npm install gulp-flatten --save-dev
var flatten = require('gulp-flatten');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants