feathers
feathers copied to clipboard
`app` property missing on setup hook
Steps to reproduce
- [ ]
app
property is missing from theHookContext
of any applicationsetup
hook.
Example :
import { MongoClient } from 'mongodb'
app.hooks({
setup: [
async (context: HookContext, next: NextFunction) => {
const mongodb = new MongoClient(yourConnectionURI)
await mongodb.connect()
context.app.set('mongodb', mongodb)
await next()
}
]
})
Taken directly from featherjs's Dove docs.
context.app
is undefined here.
Expected behavior
There should be an app
property on setup's HookContext.
Actual behavior
There is no app
property on setup's HookContext.
System configuration
Module versions (especially the part that's not working): every @feathersjs
libs version 5.0.0-pre.28
NodeJS version: 17.3.0
Very strange. It is being tested in https://github.com/feathersjs/feathers/blob/dove/packages/feathers/test/hooks/app.test.ts#L57-L92 but I can confirm that it isn't showing up in a wrapped application.