LoginSignup
1
0

More than 5 years have passed since last update.

gulp-slim でgulpからslimに渡す変数の1文字目は小文字でないとエラーになります

Last updated at Posted at 2017-02-03

gulp-slim(0.3.0)では、以下の様にgulpからslimに変数を渡せます。(dataのところです)


gulp.src("./src/slim/*.slim")
  .pipe(slim({
    pretty: true,
    data: {
      Title: "Just a list of usernames",
      Users: [
        { name: "Fred" },
        { name: "Bill" },
        { name: "Harry" }
      ]
    },
    options: "encoding='utf-8'"
  }))
  .pipe(gulp.dest("./dist/html/"));
});

ここのkeyの1文字目を大文字にすると以下の様なエラーがでました。

events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: no writecb in Transform class
    at afterTransform 
    at TransformState.afterTransform 
    at Socket.<anonymous> (
    at emitNone (events.js:91:20)
    at Socket.emit (events.js:185:7)
    at endReadableNT (_stream_readable.js:974:12)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)
error Command failed with exit code 1.

1文字目は小文字にしておけば、エラーがでませんでした。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0