assemble-workshop icon indicating copy to clipboard operation
assemble-workshop copied to clipboard

TypeError: app.watch is not a function

Open kdekooter opened this issue 8 years ago • 5 comments

Using assemble v0.17.1

...
app.task('build', [ 'init' ], function () {
  return app.pages.src('./src/pages/*.hbs')
    .pipe(app.renderFile())
    .pipe( extname())
    .pipe(app.dest('./dist'))
    .pipe(browserSync.stream())
})
app.watch('./src/layouts/default.hbs', ['build'])

Console output:

app.watch('./src/layouts/default.hbs', ['build'])
    ^

TypeError: app.watch is not a function
    at Object.<anonymous> (/Users/kees/workspaces/boplicity/api-watch-static/assemblefile.js:45:5)
    at Module._compile (module.js:573:32)
    at Object.Module._extensions..js (module.js:582:10)
    at Module.load (module.js:490:32)
    at tryModuleLoad (module.js:449:12)
    at Function.Module._load (module.js:441:3)
    at Module.require (module.js:500:17)
    at require (internal/module.js:20:19)
    at run (/usr/local/lib/node_modules/assemble/bin/cli.js:45:11)
    at Object.<anonymous> (/usr/local/lib/node_modules/assemble/bin/cli.js:132:1)

kdekooter avatar Nov 16 '16 16:11 kdekooter

@kdekooter Thanks for the issue! If you're reporting a bug, please be sure to include:

  • The version of assemble you are using.
  • Your assemblefile.js (This can be in a gist)
  • The commandline output. (Screenshot or gist is fine)
  • What you expected to happen instead.

assemblebot avatar Nov 16 '16 16:11 assemblebot

I was able to make things work by adding this:

var watch = require('base-watch')

app.use(watch())

kdekooter avatar Nov 16 '16 22:11 kdekooter

Thanks for posting this. Which recipe did you see this in?

itlackey avatar Nov 23 '16 16:11 itlackey

Sorry, I forgot to mention that. It is the browser-sync recipe.

kdekooter avatar Nov 23 '16 18:11 kdekooter

Thanks for reporting this. I have updated the recipe and submitted a PR to merge it into the repo.

itlackey avatar Nov 24 '16 05:11 itlackey