Skip to content

Commit a725a7a

Browse files
authored
fix: check watchers exist before registering hooks
resolves.#591
1 parent cfc48e5 commit a725a7a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/app.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export async function setupAppBridge (_options: any) {
3131
nuxt.hook('builder:prepared', (builder) => {
3232
nuxt.hook('build:done', () => {
3333
for (const name of ['app', 'files', 'custom']) {
34-
builder.watchers[name].on('all', (event, path) => nuxt.callHook('builder:watch', event, path))
34+
builder.watchers[name]?.on('all', (event, path) => nuxt.callHook('builder:watch', event, path))
3535
}
3636
})
3737
nuxt.hook('builder:generateApp', () => builder.generateRoutesAndFiles())

0 commit comments

Comments
 (0)