Skip to content

Commit

Permalink
fix: check watchers exist before registering hooks
Browse files Browse the repository at this point in the history
resolves.#591
  • Loading branch information
danielroe authored Oct 25, 2022
1 parent cfc48e5 commit a725a7a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export async function setupAppBridge (_options: any) {
nuxt.hook('builder:prepared', (builder) => {
nuxt.hook('build:done', () => {
for (const name of ['app', 'files', 'custom']) {
builder.watchers[name].on('all', (event, path) => nuxt.callHook('builder:watch', event, path))
builder.watchers[name]?.on('all', (event, path) => nuxt.callHook('builder:watch', event, path))
}
})
nuxt.hook('builder:generateApp', () => builder.generateRoutesAndFiles())
Expand Down

0 comments on commit a725a7a

Please sign in to comment.