diff --git a/packages/feathers/src/hooks/regular.ts b/packages/feathers/src/hooks/regular.ts index ff01715184..7c08eb6b9a 100644 --- a/packages/feathers/src/hooks/regular.ts +++ b/packages/feathers/src/hooks/regular.ts @@ -142,7 +142,7 @@ const createMap = (input: RegularHookMap, methods: string[]) => { const data = convertHookData(input[type]); Object.keys(data).forEach((method) => { - if (method !== 'all' && !methods.includes(method)) { + if (method !== 'all' && !methods.includes(method) && !defaultServiceMethods.includes(method)) { throw new Error(`'${method}' is not a valid hook method`); } }); diff --git a/packages/feathers/test/hooks/before.test.ts b/packages/feathers/test/hooks/before.test.ts index 4443341375..70b458c9e1 100644 --- a/packages/feathers/test/hooks/before.test.ts +++ b/packages/feathers/test/hooks/before.test.ts @@ -38,7 +38,9 @@ describe('`before` hooks', () => { return new Promise((_resolve, reject) => { reject(new Error('This did not work')); }); - } + }, + + find: [] } });