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

Error: Received a non-Vinyl object in dest() #53

Closed
ThePeach opened this issue Jan 4, 2018 · 2 comments
Closed

Error: Received a non-Vinyl object in dest() #53

ThePeach opened this issue Jan 4, 2018 · 2 comments

Comments

@ThePeach
Copy link

ThePeach commented Jan 4, 2018

Hello I've stumbled this error and have no idea what's wrong.

I'm using the following versions of npm and node:

$ npm --version && node --version
5.5.1
v8.9.3

I'm also using the latest version of metalsmith (2.3.0) and of metalsmith-tags (2.0.0) with gulp 4.
Here's the list of deps from package.json:

  "devDependencies": {
    "@babel/core": "^7.0.0-beta.32",
    "@babel/preset-env": "^7.0.0-beta.32",
    "@buildit/gravy": "^1.3.0",
    "babel-core": "^6.26.0",
    "babel-plugin-transform-es2015-modules-umd": "^6.24.1",
    "babel-preset-env": "^1.6.1",
    "breakpoint-sass": "^2.7.1",
    "browser-sync": "^2.18.13",
    "del": "^3.0.0",
    "eslint": "^4.3.0",
    "eslint-config-standard": "^10.2.1",
    "eslint-plugin-import": "^2.7.0",
    "eslint-plugin-node": "^5.1.1",
    "eslint-plugin-promise": "^3.5.0",
    "eslint-plugin-standard": "^3.0.1",
    "eyeglass": "^1.2.1",
    "gulp": "github:gulpjs/gulp#4.0",
    "gulp-autoprefixer": "^4.0.0",
    "gulp-babel": "^7.0.0",
    "gulp-clean-css": "^3.7.0",
    "gulp-concat": "^2.6.1",
    "gulp-filter": "^5.0.0",
    "gulp-front-matter": "^1.3.0",
    "gulp-if": "^2.0.2",
    "gulp-imagemin": "^3.3.0",
    "gulp-rename": "^1.2.2",
    "gulp-replace": "^0.6.1",
    "gulp-sass": "^3.1.0",
    "gulp-size": "^2.1.0",
    "gulp-sourcemaps": "^2.6.0",
    "gulp-uglify": "^3.0.0",
    "gulpsmith": "^0.5.5",
    "handlebars": "^4.0.10",
    "helper-moment": "^0.2.0",
    "imagemin-jpeg-recompress": "^5.1.0",
    "imagemin-pngquant": "^5.0.1",
    "metalsmith": "^2.3.0",
    "metalsmith-assets": "^0.1.0",
    "metalsmith-collections": "^0.9.0",
    "metalsmith-debug": "^1.1.0",
    "metalsmith-html-minifier": "^2.2.0",
    "metalsmith-layouts": "^1.8.1",
    "metalsmith-mapsite": "^1.0.4",
    "metalsmith-markdown": "^0.2.1",
    "metalsmith-md-summary": "0.0.1",
    "metalsmith-metallic": "^2.0.2",
    "metalsmith-permalinks": "^0.5.0",
    "metalsmith-serve": "0.0.7",
    "metalsmith-tags": "^2.0.0",
    "metalsmith-watch": "^1.0.3",
    "stylelint-config-sass-guidelines": "^3.0.1",
    "stylelint-order": "^0.6.0",
    "stylelint-scss": "^1.5.1",
    "susy": "^3.0.0",
    "swag": "^0.7.0",
    "yargs": "^8.0.2"
  },

the pipeline for metalsmith is more or less the following (reduced to the minimum where the error is still reproducible, i.e. if I disable tags and add anything else, it works fine).

function metalsmith () {
  return gulp.src(paths.pages.src)
    .pipe(fmFilter)
    .pipe(frontMatter({
      property: 'frontMatter'
    })).on('data', function (file) {
      assign(file, file.frontMatter);
      delete file.frontMatter;
    })
    .pipe(fmFilter.restore)
    .pipe(
      gulpsmith()
        .use(tags({
          'handle': 'tags',
          'path': 'tags/:tag/index.html',
          'layout': 'posts-list.hbs',
          'sortBy': 'published',
          'reverse': true,
          'skipMetadata': false,
          'slug': { 'mode': 'rfc3986' },
          'hyphenate': true
        }))        .use(debug())
    )
    .pipe(gulpIf(PRODUCTION, replace('.css', '.min.css')))
    .pipe(gulp.dest(paths.pages.dest))
    .pipe(browserSync.reload({ stream: true }));
}

the error I'm getting is the following:

[14:10:15] 'metalsmith' errored after 1.02 s
[14:10:15] Error: Received a non-Vinyl object in `dest()`
    at DestroyableTransform.normalize [as _transform] (/Users/peach/repos/blog.smartart.it-static/node_modules/vinyl-fs/lib/dest/prepare.js:16:17)
    at DestroyableTransform.Transform._read (/Users/peach/repos/blog.smartart.it-static/node_modules/readable-stream/lib/_stream_transform.js:182:10)
    at DestroyableTransform.Transform._write (/Users/peach/repos/blog.smartart.it-static/node_modules/readable-stream/lib/_stream_transform.js:170:83)
    at doWrite (/Users/peach/repos/blog.smartart.it-static/node_modules/readable-stream/lib/_stream_writable.js:406:64)
    at writeOrBuffer (/Users/peach/repos/blog.smartart.it-static/node_modules/readable-stream/lib/_stream_writable.js:395:5)
    at DestroyableTransform.Writable.write (/Users/peach/repos/blog.smartart.it-static/node_modules/readable-stream/lib/_stream_writable.js:322:11)
    at Pumpify.Duplexify._write (/Users/peach/repos/blog.smartart.it-static/node_modules/duplexify/index.js:201:22)
    at doWrite (/Users/peach/repos/blog.smartart.it-static/node_modules/readable-stream/lib/_stream_writable.js:406:64)
    at writeOrBuffer (/Users/peach/repos/blog.smartart.it-static/node_modules/readable-stream/lib/_stream_writable.js:395:5)
    at Pumpify.Writable.write (/Users/peach/repos/blog.smartart.it-static/node_modules/readable-stream/lib/_stream_writable.js:322:11)
    at DestroyableTransform.ondata (/Users/peach/repos/blog.smartart.it-static/node_modules/readable-stream/lib/_stream_readable.js:612:20)
    at emitOne (events.js:116:13)
    at DestroyableTransform.emit (events.js:211:7)
    at addChunk (/Users/peach/repos/blog.smartart.it-static/node_modules/readable-stream/lib/_stream_readable.js:284:12)
    at readableAddChunk (/Users/peach/repos/blog.smartart.it-static/node_modules/readable-stream/lib/_stream_readable.js:271:11)
    at DestroyableTransform.Readable.push (/Users/peach/repos/blog.smartart.it-static/node_modules/readable-stream/lib/_stream_readable.js:238:10)

any help would be greatly appreciated

@ThePeach
Copy link
Author

ThePeach commented Jan 5, 2018

thanks to Woody on the metalsmith slack channel, I managed to narrow down the culprit of this mess, and it seems it's down to the latest version of Gulp since they upgraded their dependency of vinyl-fs to v3 gulpjs/gulp@c1ba80c#diff-b9cfc7f2cdf78a7f4b91a753d10865a2

Regardless, this means that metalsmith-tags and possibly metalsmith-mapsite are going to have problems going forward.

@ThePeach
Copy link
Author

ThePeach commented Jan 8, 2018

this has been solved with the release of gulpsmith 0.6.0.

@ThePeach ThePeach closed this as completed Jan 8, 2018
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

1 participant