Unexpected error when using worker replay

Hi Guys I’m using Worker.runReplayHistories functionality provided by the temporal, as per this documentation,

But I’m getting the following error at the end, In the following way at Worker.runReplayHistories… any specific reason?

TypeError: Expected a non-null history object, got undefined
at Function.validateHistory (C:\Users\BHAVANAK\workflow-service\sap-broker\node_modules@temporalio\worker\lib\worker.js:293:19)
at Function.runReplayHistories (C:\Users\BHAVANAK\workflow-service\sap-broker\node_modules@temporalio\worker\lib\worker.js:238:44)
at async run (C:\Users\BHAVANAK\workflow-service\sap-broker\src\worker\worker.ts:76:92)

Can you provide the code so we can figure out where the undefined value is coming from?