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

Missing support for preClose application hook #71

Closed
knolleary opened this issue Jun 14, 2023 · 0 comments · Fixed by #72
Closed

Missing support for preClose application hook #71

knolleary opened this issue Jun 14, 2023 · 0 comments · Fixed by #72
Labels
bug Something isn't working

Comments

@knolleary
Copy link

If this module is used with a fastify plugin that uses the preClose application hook, the app will fail to start:

/Users/nol/code/ff/flowforge-dev-env/node_modules/fastify-overview/index.js:184
    this[kStructure].hooks[name].push(hookNode)
                                 ^

TypeError: Cannot read properties of undefined (reading 'push')
    at Object.wrapAddHook [as addHook] (/Users/nol/code/ff/flowforge-dev-env/node_modules/fastify-overview/index.js:184:34)
    at fastifyWebsocket (/Users/nol/code/ff/flowforge-dev-env/node_modules/@fastify/websocket/index.js:151:11)
    at Plugin.exec (/Users/nol/code/ff/flowforge-dev-env/node_modules/avvio/plugin.js:130:19)
    at Boot.loadPlugin (/Users/nol/code/ff/flowforge-dev-env/node_modules/avvio/plugin.js:272:10)

In this example we are using @fastify/websocket which uses the preClose hook.

I believe the root cause is preClose is missing from the object returned by getEmptyHookApplication

function getEmptyHookApplication () {

If I can figure out how the tests are structured, I'll see if I can PR a fix.

@Eomm Eomm added the bug Something isn't working label Jun 15, 2023
@Eomm Eomm closed this as completed in #72 Jun 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants