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

SSR Function Works in Mozilla but Not in Chrome #51814

Closed
1 task done
younes-ahmadian opened this issue Jun 26, 2023 · 6 comments
Closed
1 task done

SSR Function Works in Mozilla but Not in Chrome #51814

younes-ahmadian opened this issue Jun 26, 2023 · 6 comments
Labels
bug Issue was opened via the bug report template. Pages Router Related to Pages Router. stale The issue has not seen recent activity.

Comments

@younes-ahmadian
Copy link

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:        
      Platform: win32        
      Arch: x64              
      Version: Windows 10 Pro
    Binaries:                
      Node: 18.12.1          
      npm: N/A
      Yarn: N/A
      pnpm: N/A
    Relevant Packages:
      next: 13.4.8-canary.2
      eslint-config-next: 13.4.5
      react: 18.2.0
      react-dom: 18.2.0
      typescript: 5.1.3
    Next.js Config:
      output: standalone

Which area(s) of Next.js are affected? (leave empty if unsure)

Data fetching (gS(S)P, getInitialProps)

Link to the code that reproduces this issue or a replay of the bug

hope the description be enough.

To Reproduce

To Reproduce:

Navigate to the payment page in my Next.js application.
Initiate a payment and get redirected to the bank page.
Complete the payment process on the bank page.
After the payment is completed, you should be redirected back to my Next.js application's destination page.
On the destination page, the SSR function should retrieve and display certain information.

Describe the Bug

Hello there

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.

The problem is that the SSR function works as expected in Mozilla, but it doesn't seem to work properly in Chrome and gets no data in SSR. if i reload the page in returning page data is present and everything is ok. I have tried clearing the cache and checking network requests, but the issue persists. I'm wondering if there might be any browser-specific behavior or compatibility issues causing this discrepancy.

Could anyone provide guidance on how to troubleshoot and fix this issue? I would greatly appreciate any insights or suggestions.

SSR request in returning page is as follow:

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 } };
});
}

after reloading the returning page the data is present and everything is ok.

Expected Behavior

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.

Which browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

@younes-ahmadian younes-ahmadian added the bug Issue was opened via the bug report template. label Jun 26, 2023
@github-actions github-actions bot added the Pages Router Related to Pages Router. label Jun 26, 2023
@icyJoseph
Copy link
Contributor

Are you using PWA? like next-pwa?

@ebo-bpi
Copy link

ebo-bpi commented Jun 30, 2023

Check cookie settings. Chrome is more strict in rejecting cookies then Firefox.

@younes-ahmadian
Copy link
Author

younes-ahmadian commented Jul 3, 2023

Are you using PWA? like next-pwa?

yeah, i'm using next-pwa. but the issue was related to the attribute of cookie settings, as mentioned by @ebo-bpi.

@younes-ahmadian
Copy link
Author

Check cookie settings. Chrome is more strict in rejecting cookies then Firefox.

That's right. thanks for your hint.

@nextjs-bot
Copy link
Collaborator

This issue has been automatically marked as stale due to two years of inactivity. It will be closed in 7 days unless there’s further input. If you believe this issue is still relevant, please leave a comment or provide updated details. Thank you.

@nextjs-bot nextjs-bot added the stale The issue has not seen recent activity. label Feb 16, 2025
@nextjs-bot
Copy link
Collaborator

This issue has been automatically closed due to two years of inactivity. If you’re still experiencing a similar problem or have additional details to share, please open a new issue following our current issue template. Your updated report helps us investigate and address concerns more efficiently. Thank you for your understanding!

@nextjs-bot nextjs-bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template. Pages Router Related to Pages Router. stale The issue has not seen recent activity.
Projects
None yet
Development

No branches or pull requests

4 participants