getting log.patching undefined in hapi.js
Closed this issue · 2 comments
log.patching('hapi.generator.request not a function');
^
ReferenceError: log is not defined
at patchGenerator (/home/xxxx/xxxx/node_modules/appoptics-apm/dist/probes/hapi.js:154:5)
Getting this when requiring hapi.js
Noticed that in mongoose.js there is
const ao = require('..')
const log = ao.loggers
But i don't see the const log line in hapi.js. Maybe it was being defined in the surrounding code, but i couldn't see it. i guess would this would only fly if an app was using hapi.
When i manually edit my node_modules hapi.js file to have the const log = ao.loggers line things start up.
We are running hapi 17.5 which might be why this line of code is firing anyways.
v5.4.0 of your stuff.
Thanks for the information and putting a fix in place twiggy. You're right about the missing const log = ao.loggers
.
It's likely the reason that the message is firing is because v17 likely changed the structure of the objects that need to be patched. This is fixed in our code right now but it's likely that changes are required to the hapi probe itself for tracing to work correctly.
This is fixed in v5.4.1.
Hapi v17 will take longer - it's a complete rewrite on their part.