I'm facing an issue with my Next.js project involving server-side rendering (SSR). In my application, I have a payment flow where the user is redirected to a bank page for payment. Upon returning to my page, I rely on an SSR function to retrieve and display some information.
Expected behavior:
The SSR function retrieves and displays the expected information on the destination page consistently across different browsers.
Actual behavior:
The SSR function works as expected in Mozilla, but doesn't work correctly in Chrome. When returning to the destination page in Chrome, the SSR function fails to retrieve and display the expected information. If reload the page in the destination page the expected data is present.
Get server side props
export async function getServerSideProps(context: any) {
const { transactionId } = context.params;
const { token } = context.req.cookies;
return await GETSSR(bankTransaction(transactionId, ServiceType), token).then(
(e) => {
return { props: { result: e.result } };
}
);
}
Could anyone provide guidance on how to troubleshoot and fix this issue? I would greatly appreciate any insights or suggestions.