You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 4, 2023. It is now read-only.
~/node_modules/aws-xray-sdk-core/lib/utils.js:19
var stat = status.toString();
^
TypeError: Cannot read property 'toString' of undefined
at Object.getCauseTypeFromHttpStatus (~/node_modules/aws-xray-sdk-core/lib/utils.js:19:23)
at Object.fastifyXrayOnResponse (~/node_modules/fastify-xray/plugin.js:84:33)
at onResponseIterator (~/node_modules/fastify/lib/reply.js:502:10)
at next (~/node_modules/fastify/lib/hooks.js:70:20)
at hookRunner (~/node_modules/fastify/lib/hooks.js:84:3)
at ServerResponse.onResFinished (~/node_modules/fastify/lib/reply.js:485:7)
at ServerResponse.emit (events.js:203:15)
at ServerResponse.EventEmitter.emit (domain.js:448:20)
at ServerResponse.emitted (~/node_modules/emitter-listener/listener.js:134:21)
at onFinish (_http_outgoing.js:671:10)
at process._tickCallback (internal/process/next_tick.js:61:11)
From initial investigation, this is because [email protected] does not yet have the getter for statusCode. This results in fastify-xray/plugin.js:84:33 to pass undefined to getCauseTypeFromHttpStatus
node_modules/fastify-xray/plugin.js
const cause = AWSXRay.utils.getCauseTypeFromHttpStatus(reply.statusCode) // reply doesn't have a statusCode getter/property as of [email protected]
node_modules/aws-xray-sdk-core/lib/utils.js
getCauseTypeFromHttpStatus: function getCauseTypeFromHttpStatus(status) {
var stat = status.toString();
if (stat.match(/^[4][0-9]{2}$/) !== null)
return 'error';
else if (stat.match(/^[5][0-9]{2}$/) !== null)
return 'fault';
}
Quick workaround that I did is to inject a getter for this:
Library versions where error is encountered
Error
From initial investigation, this is because [email protected] does not yet have the getter for
statusCode
. This results in fastify-xray/plugin.js:84:33 to pass undefined to getCauseTypeFromHttpStatusnode_modules/fastify-xray/plugin.js
node_modules/aws-xray-sdk-core/lib/utils.js
Quick workaround that I did is to inject a getter for this:
The text was updated successfully, but these errors were encountered: