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: app.watch is not a function #12

Open
kdekooter opened this issue Nov 16, 2016 · 5 comments
Open

TypeError: app.watch is not a function #12

kdekooter opened this issue Nov 16, 2016 · 5 comments

Comments

@kdekooter
Copy link

kdekooter commented Nov 16, 2016

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)
@assemblebot
Copy link

@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.

@kdekooter
Copy link
Author

I was able to make things work by adding this:

var watch = require('base-watch')

app.use(watch())

@itlackey
Copy link
Contributor

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

@kdekooter
Copy link
Author

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

@itlackey
Copy link
Contributor

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

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